use of com.vaadin.flow.component.textfield.TextField in project aire-components by aire-ux.
the class ModuleGrid method valueChanged.
@Override
public void valueChanged(ComponentValueChangeEvent<TextField, String> event) {
val text = textField.getValue();
val matches = getZephyr().getPlugins().stream().filter(module -> module.getCoordinate().getName().contains(text) || module.getCoordinate().getGroup().contains(text) || module.getCoordinate().getVersion().toString().contains(text)).collect(Collectors.toList());
grid.setItems(new ListDataProvider<>(matches));
}
use of com.vaadin.flow.component.textfield.TextField 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.textfield.TextField in project docs by vaadin.
the class DialogBasic method createDialogLayout.
private static VerticalLayout createDialogLayout(Dialog dialog) {
H2 headline = new H2("Create new employee");
headline.getStyle().set("margin", "var(--lumo-space-m) 0 0 0").set("font-size", "1.5em").set("font-weight", "bold");
TextField firstNameField = new TextField("First name");
TextField lastNameField = new TextField("Last name");
VerticalLayout fieldLayout = new VerticalLayout(firstNameField, lastNameField);
fieldLayout.setSpacing(false);
fieldLayout.setPadding(false);
fieldLayout.setAlignItems(FlexComponent.Alignment.STRETCH);
Button cancelButton = new Button("Cancel", e -> dialog.close());
Button saveButton = new Button("Save", e -> dialog.close());
saveButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
HorizontalLayout buttonLayout = new HorizontalLayout(cancelButton, saveButton);
buttonLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.END);
VerticalLayout dialogLayout = new VerticalLayout(headline, fieldLayout, buttonLayout);
dialogLayout.setPadding(false);
dialogLayout.setAlignItems(FlexComponent.Alignment.STRETCH);
dialogLayout.getStyle().set("width", "300px").set("max-width", "100%");
return dialogLayout;
}
use of com.vaadin.flow.component.textfield.TextField in project layout-examples by vaadin.
the class FixedNavStickyFooterView method createHeader.
public void createHeader() {
RouterLink titleLink = new RouterLink("Fixed navbar", getClass());
titleLink.addClassName("titleLink");
header.add(titleLink);
header.add(new RouterLink("Home", getClass()));
header.add(new Anchor("#", "Link"));
Anchor a = new Anchor("#", "Help");
// Stretches this item in the flex container so that the following items
// will be at the right side of the screen.
a.getStyle().set("margin-right", "auto");
header.add(a);
Div searchBlock = new Div();
searchBlock.addClassName("searchBlock");
TextField searchField = new TextField();
searchField.setPlaceholder("Search");
searchField.addClassName("searchField");
searchBlock.add(searchField);
Button searchButton = new Button("Search");
searchButton.addClassName("searchButton");
searchBlock.add(searchButton);
header.add(searchBlock);
}
use of com.vaadin.flow.component.textfield.TextField 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