use of com.vaadin.flow.component.combobox.test.entity.Element in project flow-components by vaadin.
the class ComboBoxView method customFiltering.
private void customFiltering() {
Div div = new Div();
div.setText("Example uses case-sensitive starts-with filtering");
ComboBox<Element> filteringComboBox = new ComboBox<>();
List<Element> elementsList = getElements();
/*
* Providing a custom item filter allows filtering based on all of the
* rendered properties:
*/
ItemFilter<Element> filter = (element, filterString) -> element.getName().startsWith(filterString);
filteringComboBox.setItems(filter, elementsList);
filteringComboBox.setItemLabelGenerator(Element::getName);
filteringComboBox.setClearButtonVisible(true);
addCard("Filtering", "Custom filtering", div, filteringComboBox);
}
use of com.vaadin.flow.component.combobox.test.entity.Element in project flow-components by vaadin.
the class ElementData method createElementList.
private static List<Element> createElementList() {
List<Element> elementList = new ArrayList<>();
elementList.add(new Element("Hydrogen"));
elementList.add(new Element("Helium"));
elementList.add(new Element("Lithium"));
elementList.add(new Element("Beryllium"));
elementList.add(new Element("Boron"));
elementList.add(new Element("Carbon"));
elementList.add(new Element("Nitrogen"));
elementList.add(new Element("Oxygen"));
elementList.add(new Element("Fluorine"));
elementList.add(new Element("Neon"));
elementList.add(new Element("Sodium"));
elementList.add(new Element("Magnesium"));
elementList.add(new Element("Aluminum"));
elementList.add(new Element("Silicon"));
elementList.add(new Element("Phosphorus"));
elementList.add(new Element("Sulfur"));
elementList.add(new Element("Chlorine"));
elementList.add(new Element("Argon"));
elementList.add(new Element("Potassium"));
elementList.add(new Element("Calcium"));
elementList.add(new Element("Scandium"));
elementList.add(new Element("Titanium"));
elementList.add(new Element("Vanadium"));
elementList.add(new Element("Chromium"));
elementList.add(new Element("Manganese"));
elementList.add(new Element("Iron"));
elementList.add(new Element("Cobalt"));
elementList.add(new Element("Nickel"));
elementList.add(new Element("Copper"));
elementList.add(new Element("Zinc"));
elementList.add(new Element("Gallium"));
elementList.add(new Element("Germanium"));
elementList.add(new Element("Arsenic"));
elementList.add(new Element("Selenium"));
elementList.add(new Element("Bromine"));
elementList.add(new Element("Krypton"));
elementList.add(new Element("Rubidium"));
elementList.add(new Element("Strontium"));
elementList.add(new Element("Yttrium"));
elementList.add(new Element("Zirconium"));
elementList.add(new Element("Niobium"));
elementList.add(new Element("Molybdenum"));
elementList.add(new Element("Technetium"));
elementList.add(new Element("Ruthenium"));
elementList.add(new Element("Rhodium"));
elementList.add(new Element("Palladium"));
elementList.add(new Element("Silver"));
elementList.add(new Element("Cadmium"));
elementList.add(new Element("Indium"));
elementList.add(new Element("Tin"));
elementList.add(new Element("Antimony"));
elementList.add(new Element("Tellurium"));
elementList.add(new Element("Iodine"));
elementList.add(new Element("Xenon"));
elementList.add(new Element("Cesium"));
elementList.add(new Element("Barium"));
elementList.add(new Element("Lanthanum"));
elementList.add(new Element("Cerium"));
elementList.add(new Element("Praseodymium"));
elementList.add(new Element("Neodymium"));
elementList.add(new Element("Promethium"));
elementList.add(new Element("Samarium"));
elementList.add(new Element("Europium"));
elementList.add(new Element("Gadolinium"));
elementList.add(new Element("Terbium"));
elementList.add(new Element("Dysprosium"));
elementList.add(new Element("Holmium"));
elementList.add(new Element("Erbium"));
elementList.add(new Element("Thulium"));
elementList.add(new Element("Ytterbium"));
elementList.add(new Element("Lutetium"));
elementList.add(new Element("Hafnium"));
elementList.add(new Element("Tantalum"));
elementList.add(new Element("Tungsten"));
elementList.add(new Element("Rhenium"));
elementList.add(new Element("Osmium"));
elementList.add(new Element("Iridium"));
elementList.add(new Element("Platinum"));
elementList.add(new Element("Gold"));
elementList.add(new Element("Mercury"));
elementList.add(new Element("Thallium"));
elementList.add(new Element("Lead"));
elementList.add(new Element("Bismuth"));
elementList.add(new Element("Polonium"));
elementList.add(new Element("Astatine"));
elementList.add(new Element("Radon"));
elementList.add(new Element("Francium"));
elementList.add(new Element("Radium"));
elementList.add(new Element("Actinium"));
elementList.add(new Element("Thorium"));
elementList.add(new Element("Protactinium"));
elementList.add(new Element("Uranium"));
elementList.add(new Element("Neptunium"));
elementList.add(new Element("Plutonium"));
elementList.add(new Element("Americium"));
elementList.add(new Element("Curium"));
elementList.add(new Element("Berkelium"));
elementList.add(new Element("Californium"));
elementList.add(new Element("Einsteinium"));
elementList.add(new Element("Fermium"));
elementList.add(new Element("Mendelevium"));
elementList.add(new Element("Nobelium"));
elementList.add(new Element("Lawrencium"));
elementList.add(new Element("Rutherfordium"));
elementList.add(new Element("Dubnium"));
elementList.add(new Element("Seaborgium"));
elementList.add(new Element("Bohrium"));
elementList.add(new Element("Hassium"));
elementList.add(new Element("Meitnerium"));
elementList.add(new Element("Ununnilium"));
elementList.add(new Element("Unununium"));
elementList.add(new Element("Ununbium"));
elementList.add(new Element("Ununtrium"));
elementList.add(new Element("Ununquadium"));
elementList.add(new Element("Ununpentium"));
elementList.add(new Element("Ununhexium"));
elementList.add(new Element("Ununseptium"));
elementList.add(new Element("Ununoctium"));
return elementList;
}
Aggregations