Search in sources :

Example 31 with Icon

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);
}
Also used : Button(com.vaadin.flow.component.button.Button) InputViewRequestedEvent(org.archcnl.ui.outputview.sidebar.events.InputViewRequestedEvent) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 32 with Icon

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);
    }
}
Also used : Button(com.vaadin.flow.component.button.Button) AddAndOrStatementComponentEvent(org.archcnl.ui.inputview.rulesormappingeditorview.architectureruleeditor.events.AddAndOrStatementComponentEvent) Icon(com.vaadin.flow.component.icon.Icon) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) RemoveAndOrVerbComponentEvent(org.archcnl.ui.inputview.rulesormappingeditorview.architectureruleeditor.events.RemoveAndOrVerbComponentEvent) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 33 with Icon

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;
}
Also used : Button(com.vaadin.flow.component.button.Button) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) HierarchyNode(org.archcnl.domain.common.HierarchyNode) HierarchyObject(org.archcnl.domain.common.conceptsandrelations.HierarchyObject) Icon(com.vaadin.flow.component.icon.Icon) Button(com.vaadin.flow.component.button.Button) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 34 with Icon

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;
}
Also used : Button(com.vaadin.flow.component.button.Button) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon)

Example 35 with Icon

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);
}
Also used : RouterLink(com.vaadin.flow.router.RouterLink) Tab(com.vaadin.flow.component.tabs.Tab) VaadinIcon(com.vaadin.flow.component.icon.VaadinIcon) Icon(com.vaadin.flow.component.icon.Icon) Span(com.vaadin.flow.component.html.Span)

Aggregations

Icon (com.vaadin.flow.component.icon.Icon)110 VaadinIcon (com.vaadin.flow.component.icon.VaadinIcon)94 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)46 Button (com.vaadin.flow.component.button.Button)39 Span (com.vaadin.flow.component.html.Span)21 Div (com.vaadin.flow.component.html.Div)19 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)18 Tab (com.vaadin.flow.component.tabs.Tab)16 Text (com.vaadin.flow.component.Text)15 Test (org.junit.Test)12 EnhancedButton (org.komunumo.ui.component.EnhancedButton)12 Grid (com.vaadin.flow.component.grid.Grid)10 RouterLink (com.vaadin.flow.router.RouterLink)9 Notification (com.vaadin.flow.component.notification.Notification)8 Component (com.vaadin.flow.component.Component)7 ColumnTextAlign (com.vaadin.flow.component.grid.ColumnTextAlign)7 Anchor (com.vaadin.flow.component.html.Anchor)7 TextField (com.vaadin.flow.component.textfield.TextField)7 UI (com.vaadin.flow.component.UI)6 StreamResource (com.vaadin.flow.server.StreamResource)6