Search in sources :

Example 1 with SelectOptionImpl

use of org.uberfire.ext.widgets.common.client.select.SelectOptionImpl in project kie-wb-common by kiegroup.

the class CategoryUtils method createCategories.

/**
 * Create a list of SelectOptions  with all the categories and the ALL Option, to be used
 * in {@link SelectComponent}
 * @return the list of SelectOptions
 */
public List<SelectOption> createCategories() {
    List<SelectOption> options = new ArrayList<>();
    options.add(new SelectOptionImpl("ALL", ts.getTranslation(LibraryConstants.ALL)));
    options.addAll(categoriesManagerCache.getCategories().stream().map(category -> new SelectOptionImpl(category.getName(), ts.getTranslation(category.getName()))).collect(Collectors.toList()));
    return options;
}
Also used : SelectOption(org.uberfire.ext.widgets.common.client.select.SelectOption) ArrayList(java.util.ArrayList) SelectOptionImpl(org.uberfire.ext.widgets.common.client.select.SelectOptionImpl)

Aggregations

ArrayList (java.util.ArrayList)1 SelectOption (org.uberfire.ext.widgets.common.client.select.SelectOption)1 SelectOptionImpl (org.uberfire.ext.widgets.common.client.select.SelectOptionImpl)1