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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations