use of com.vaadin.flow.component.icon.Icon in project karnak by OsiriX-Foundation.
the class ProfileComponent method createDownloadButton.
public void createDownloadButton(ProfileEntity profileEntity) {
final StreamResource profileStreamResource = createStreamResource(profileEntity);
download = new Anchor(profileStreamResource, "");
download.getElement().setAttribute("download", true);
download.add(new Button(new Icon(VaadinIcon.DOWNLOAD_ALT)));
download.getStyle().set("margin-top", "30px");
}
use of com.vaadin.flow.component.icon.Icon in project karnak by OsiriX-Foundation.
the class ProfileComponent method createDeleteButton.
private void createDeleteButton(ProfileEntity profileEntity) {
deleteButton = new Button((new Icon(VaadinIcon.TRASH)));
deleteButton.setWidth("100%");
deleteButton.addThemeVariants(ButtonVariant.LUMO_ERROR, ButtonVariant.LUMO_PRIMARY);
deleteButton.getStyle().set("margin-top", "34px");
deleteButton.addClickListener(buttonClickEvent -> {
if (profileEntity.getProjectEntities() != null && !profileEntity.getProjectEntities().isEmpty()) {
dialogWarning.setText(profileEntity);
dialogWarning.open();
} else {
profileLogic.deleteProfile(profileEntity);
removeAll();
}
});
}
use of com.vaadin.flow.component.icon.Icon in project projecte-dam-v2-equip2 by IESEBRE.
the class MainLayout method createHeader.
private void createHeader() {
H1 logo = new H1("");
logo.addClassNames("text-l", "m-m");
Image logo1 = new Image("https://i.ibb.co/52282JQ/Pi-Story-Cheek.png", "a");
logo1.setHeight(56, Unit.PIXELS);
logo1.setWidth(106, Unit.PIXELS);
logo1.addClickListener(e -> {
UI.getCurrent().navigate(ListView.class);
});
addToNavbar(logo1);
HorizontalLayout header = new HorizontalLayout(logo);
header.setWidth("70%");
header.addClassNames("py-0", "px-m");
addToNavbar(header);
logo.addClickListener(e -> {
UI.getCurrent().navigate(ListView.class);
});
if (user != null) {
Button add = new Button("Add", new Icon(VaadinIcon.PLUS_CIRCLE));
add.addThemeVariants(ButtonVariant.LUMO_TERTIARY);
add.setWidth("10%");
addToNavbar(add);
add.addClickListener(e -> {
UI.getCurrent().navigate("uploadImatge");
});
Button logout = new Button("Logout", new Icon(VaadinIcon.OUT));
logout.addThemeVariants(ButtonVariant.LUMO_TERTIARY);
logout.setWidth("10%");
addToNavbar(logout);
logout.addClickListener(e -> {
UI.getCurrent().getPage().setLocation("login");
VaadinSession.getCurrent().getSession().invalidate();
VaadinSession.getCurrent().close();
});
} else {
Button login = new Button("Login", new Icon(VaadinIcon.USER));
login.addThemeVariants(ButtonVariant.LUMO_TERTIARY);
login.setWidth("10%");
addToNavbar(login);
login.addClickListener(e -> {
UI.getCurrent().navigate("login");
});
}
}
use of com.vaadin.flow.component.icon.Icon in project flow-viritin by viritin.
the class Tree method editChild.
/**
* Edits child in UI.
*
* @param item the item to be edited in the UI
*/
public void editChild(T item) {
TreeItem treeItem = domainObjectToTreeItem.get(item);
Span nodeContent = (Span) treeItem.getNodeContent();
Optional<Component> optIcon = treeItem.getNodeContent().getChildren().filter(c -> c instanceof Icon).findFirst();
Optional<Component> optSpan = treeItem.getNodeContent().getChildren().filter(c -> c instanceof Span).findFirst();
if (optIcon.isPresent() && optSpan.isPresent()) {
Icon icon = (Icon) optIcon.get();
Span span = (Span) optSpan.get();
nodeContent.remove(icon);
nodeContent.remove(span);
span.getChildren().filter(cc -> cc instanceof Text).findFirst().ifPresent(cc -> {
((Text) cc).setText(itemLabelGenerator.apply(item));
});
nodeContent.add(itemIconGenerator.apply(item));
nodeContent.add(span);
}
}
use of com.vaadin.flow.component.icon.Icon in project layout-examples by vaadin.
the class PricingView method createFooter.
private void createFooter() {
Div box;
box = new Div();
box.addClassName("copyright-box");
Paragraph copyright = new Paragraph("© 2019");
copyright.addClassName("copyright");
box.add(new Icon(VaadinIcon.VAADIN_H), copyright);
footer.add(box);
box = new Div();
box.add(new H2("Features"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Cool stuff")), new ListItem(new Anchor("#", "Random feature")), new ListItem(new Anchor("#", "Team feature")), new ListItem(new Anchor("#", "Stuff for developers")), new ListItem(new Anchor("#", "Another one")), new ListItem(new Anchor("#", "Last time"))));
footer.add(box);
box = new Div();
box.add(new H2("Resources"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Resource")), new ListItem(new Anchor("#", "Resource name")), new ListItem(new Anchor("#", "Another resource")), new ListItem(new Anchor("#", "Final resource"))));
footer.add(box);
box = new Div();
box.add(new H2("About"));
box.add(new UnorderedList(new ListItem(new Anchor("#", "Team")), new ListItem(new Anchor("#", "Locations")), new ListItem(new Anchor("#", "Privacy")), new ListItem(new Anchor("#", "Terms"))));
footer.add(box);
}
Aggregations