Search in sources :

Example 1 with MenuBar

use of com.vaadin.flow.component.menubar.MenuBar in project aire-components by aire-ux.

the class AddFeatureFlagOverlay method addFooter.

private void addFooter() {
    val menubar = new MenuBar();
    menubar.addThemeVariants(MenuBarVariant.LUMO_ICON, MenuBarVariant.LUMO_TERTIARY_INLINE);
    val cancel = new Button("Cancel", VaadinIcon.CLOSE.create());
    cancel.addClickListener(event -> this.cancel());
    val install = new Button("Save", VaadinIcon.UPLOAD_ALT.create());
    install.addClickListener(this::onSuccess);
    menubar.addItem(cancel);
    menubar.addItem(install);
    getFooter().add(menubar);
}
Also used : lombok.val(lombok.val) Button(com.vaadin.flow.component.button.Button) MenuBar(com.vaadin.flow.component.menubar.MenuBar)

Example 2 with MenuBar

use of com.vaadin.flow.component.menubar.MenuBar in project aire-components by aire-ux.

the class FeatureList method createMenuBar.

private Component createMenuBar() {
    val result = new MenuBar();
    result.addThemeVariants(MenuBarVariant.LUMO_SMALL, MenuBarVariant.LUMO_ICON, MenuBarVariant.LUMO_TERTIARY_INLINE);
    searchField = new TextField();
    searchField.setPlaceholder("Search");
    searchField.setClearButtonVisible(true);
    searchField.setPrefixComponent(VaadinIcon.SEARCH.create());
    searchField.setValueChangeMode(ValueChangeMode.EAGER);
    searchField.addValueChangeListener(this);
    result.addItem(searchField);
    val addButton = new Button("Add Feature Flag", VaadinIcon.PLUS.create());
    addButton.addClickListener(click -> {
        val overlay = Overlays.open(this, AddFeatureFlagOverlay.class);
        overlay.addOverlayClosedEventListener(event -> {
            if (!event.isCancelled()) {
                featureManager.registerFeature(overlay.getValue());
                grid.getDataProvider().refreshAll();
            }
        });
    });
    result.addItem(addButton);
    return result;
}
Also used : lombok.val(lombok.val) Button(com.vaadin.flow.component.button.Button) MenuBar(com.vaadin.flow.component.menubar.MenuBar) TextField(com.vaadin.flow.component.textfield.TextField)

Example 3 with MenuBar

use of com.vaadin.flow.component.menubar.MenuBar in project aire-components by aire-ux.

the class TopologyView method createMenuBar.

private MenuBar createMenuBar() {
    val result = new MenuBar();
    result.getStyle().set("align-self", "flex-start");
    result.addThemeVariants(MenuBarVariant.LUMO_TERTIARY);
    return result;
}
Also used : lombok.val(lombok.val) MenuBar(com.vaadin.flow.component.menubar.MenuBar)

Example 4 with MenuBar

use of com.vaadin.flow.component.menubar.MenuBar in project aire-components by aire-ux.

the class ModuleGrid method createMenubar.

private Component createMenubar() {
    val result = new MenuBar();
    result.addThemeVariants(MenuBarVariant.LUMO_SMALL, MenuBarVariant.LUMO_ICON, MenuBarVariant.LUMO_TERTIARY_INLINE);
    textField = new TextField();
    textField.setPlaceholder("Search");
    textField.setClearButtonVisible(true);
    textField.setPrefixComponent(VaadinIcon.SEARCH.create());
    textField.setValueChangeMode(ValueChangeMode.EAGER);
    textField.addValueChangeListener(this);
    result.addItem(textField);
    addButtonsToMenubar(result);
    return result;
}
Also used : lombok.val(lombok.val) MenuBar(com.vaadin.flow.component.menubar.MenuBar) TextField(com.vaadin.flow.component.textfield.TextField)

Example 5 with MenuBar

use of com.vaadin.flow.component.menubar.MenuBar in project layout-examples by vaadin.

the class ListingFormView method createHeader.

private Component createHeader() {
    MenuBar menuBar = new MenuBar();
    menuBar.getStyle().set("flex-grow", "1");
    menuBar.addItem("Today's Deals");
    menuBar.addItem("Help");
    menuBar.addItem("Registry");
    // This HorizontalLayout contains the menuBar, searchTextField and
    // searchButton.
    HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.setWidthFull();
    TextField searchTextField = new TextField();
    searchTextField.getStyle().set("overflow", "auto");
    searchTextField.setPlaceholder("Search");
    searchTextField.setValue("Vaadin");
    Button searchButton = new Button("Search");
    searchButton.getStyle().set("overflow", "auto");
    headerLayout.add(menuBar, searchTextField, searchButton);
    headerLayout.getStyle().set("background-color", "#F8F8F8");
    headerLayout.getStyle().set("flex-shrink", "0");
    return headerLayout;
}
Also used : Button(com.vaadin.flow.component.button.Button) MenuBar(com.vaadin.flow.component.menubar.MenuBar) TextField(com.vaadin.flow.component.textfield.TextField) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Aggregations

MenuBar (com.vaadin.flow.component.menubar.MenuBar)22 MenuItem (com.vaadin.flow.component.contextmenu.MenuItem)9 Test (org.junit.jupiter.api.Test)8 Button (com.vaadin.flow.component.button.Button)6 lombok.val (lombok.val)6 SubMenu (com.vaadin.flow.component.contextmenu.SubMenu)3 TextField (com.vaadin.flow.component.textfield.TextField)3 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)2 ComponentEvent (com.vaadin.flow.component.ComponentEvent)1 ComponentEventListener (com.vaadin.flow.component.ComponentEventListener)1 Text (com.vaadin.flow.component.Text)1 Unit (com.vaadin.flow.component.Unit)1 Anchor (com.vaadin.flow.component.html.Anchor)1 Image (com.vaadin.flow.component.html.Image)1 Label (com.vaadin.flow.component.html.Label)1 Span (com.vaadin.flow.component.html.Span)1 Notification (com.vaadin.flow.component.notification.Notification)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 RouterLink (com.vaadin.flow.router.RouterLink)1 VaadinService (com.vaadin.flow.server.VaadinService)1