Search in sources :

Example 1 with Filterable

use of com.vaadin.data.Container.Filterable in project VaadinUtils by rlsutton1.

the class TwinColumnSearchableSelect method createAvailableTable.

private void createAvailableTable() {
    availableTable = new SearchableSelectableEntityTable<C>(this.getClass().getSimpleName()) {

        private static final long serialVersionUID = 1L;

        @Override
        public HeadingPropertySet getHeadingPropertySet() {
            return new HeadingPropertySet.Builder<C>().addColumn(availableColumnHeader, itemLabel).build();
        }

        @Override
        public Filterable getContainer() {
            return availableContainer;
        }

        @Override
        protected Filter getContainerFilter(String filterString, boolean advancedSearchActive) {
            Filter searchFilter = null;
            if (filterString != null && filterString.length() > 0) {
                searchFilter = getSearchFilter(filterString);
            }
            return NullFilter.and(baselineFilter, selectedFilter, searchFilter);
        }

        @Override
        protected String getTitle() {
            return "";
        }
    };
    availableTable.addItemClickListener(new ItemClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void itemClick(ItemClickEvent event) {
            if (event.isDoubleClick()) {
                addButton.click();
            }
        }
    });
    availableTable.disableSelectable();
    availableTable.setWidth(200, Unit.PIXELS);
    availableTable.setHeight(300, Unit.PIXELS);
}
Also used : HeadingPropertySet(au.com.vaadinutils.crud.HeadingPropertySet) ItemClickListener(com.vaadin.event.ItemClickEvent.ItemClickListener) Filter(com.vaadin.data.Container.Filter) NullFilter(au.com.vaadinutils.dao.NullFilter) SimpleStringFilter(com.vaadin.data.util.filter.SimpleStringFilter) Filterable(com.vaadin.data.Container.Filterable) ItemClickEvent(com.vaadin.event.ItemClickEvent)

Aggregations

HeadingPropertySet (au.com.vaadinutils.crud.HeadingPropertySet)1 NullFilter (au.com.vaadinutils.dao.NullFilter)1 Filter (com.vaadin.data.Container.Filter)1 Filterable (com.vaadin.data.Container.Filterable)1 SimpleStringFilter (com.vaadin.data.util.filter.SimpleStringFilter)1 ItemClickEvent (com.vaadin.event.ItemClickEvent)1 ItemClickListener (com.vaadin.event.ItemClickEvent.ItemClickListener)1