use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class SideBarWidget method addReturnButton.
public void addReturnButton() {
final Button returnButton = new Button("Return to rule editor", new Icon(VaadinIcon.CHEVRON_LEFT), click -> fireEvent(new InputViewRequestedEvent(this, true)));
add(returnButton);
}
use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class DefaultStatementComponent method initializeAndOrButtons.
private void initializeAndOrButtons() {
if (isAndOrBlock) {
HorizontalLayout boxButtonLayout = new HorizontalLayout();
Button addButton = new Button(new Icon(VaadinIcon.PLUS), click -> fireEvent(new AddAndOrStatementComponentEvent(this, true)));
Button deleteButton = new Button(new Icon(VaadinIcon.TRASH), click -> fireEvent(new RemoveAndOrVerbComponentEvent(this, true)));
boxButtonLayout.add(addButton, deleteButton);
horizontalRowLayout.add(boxButtonLayout);
horizontalRowLayout.setVerticalComponentAlignment(Alignment.END, boxButtonLayout);
}
}
use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class HierarchyEntryLayoutFactory method createEditable.
public HierarchyEntryLayout<T> createEditable(HierarchyNode<T> node) {
HierarchyEntryLayout<T> newLayout = new HierarchyEntryLayout<T>(node);
newLayout.add(new Button(new Icon(VaadinIcon.EDIT), click -> {
newLayout.handleEditorRequestEvent();
}));
newLayout.add(new Button(new Icon(VaadinIcon.TRASH), click -> {
newLayout.handleDelteEvent();
}));
return newLayout;
}
use of com.vaadin.flow.component.icon.Icon in project ArchCNL by Mari-Wie.
the class HierarchyEntryLayoutFactory method createRemovable.
public HierarchyEntryLayout<T> createRemovable(HierarchyNode<T> node) {
HierarchyEntryLayout<T> newLayout = new HierarchyEntryLayout<T>(node);
if (node.getChildren().size() == 0) {
Button newButton = new Button(new Icon(VaadinIcon.TRASH), click -> {
newLayout.handleDelteEvent();
});
// TODO button should not ne only invisible when children are there but should be greyed
// out
// newButton.setEnabled(false);
// newButton.getElement().setProperty("title", "Nodes with more than 0 children cannot
// be removed");
newLayout.add(newButton);
}
return newLayout;
}
use of com.vaadin.flow.component.icon.Icon in project docs by vaadin.
the class AppLayoutBasic method createTab.
private Tab createTab(VaadinIcon viewIcon, String viewName) {
Icon icon = viewIcon.create();
icon.getStyle().set("box-sizing", "border-box").set("margin-inline-end", "var(--lumo-space-m)").set("margin-inline-start", "var(--lumo-space-xs)").set("padding", "var(--lumo-space-xs)");
RouterLink link = new RouterLink();
link.add(icon, new Span(viewName));
// Demo has no routes
// link.setRoute(viewClass.java);
link.setTabIndex(-1);
return new Tab(link);
}
Aggregations