Package com.vaadin.data.Container

Examples of com.vaadin.data.Container.Filterable


        Item item = table.addItem("1");
        item.getItemProperty(PROPERTY_1).setValue("Row 1");
        item = table.addItem("2");
        item.getItemProperty(PROPERTY_1).setValue("Row 2");

        Filterable filterable = (Container.Filterable) table
                .getContainerDataSource();
        filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row",
                true, false));

        table.setColumnHeader(PROPERTY_1, "Test (filter: Row)");

        mainWin.addComponent(table);
View Full Code Here


                    }
                }));
    }

    protected void addItem() {
        Filterable filterable = (Container.Filterable) table
                .getContainerDataSource();

        Item i = table.addItem("abc");
        String res = "";
        if (i == null) {
            res = "FAILED";
        } else {
            res = "OK!";
        }

        getMainWindow().showNotification("Tried to add item 'abc', " + res);

        filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row",
                true, false));

    }
View Full Code Here

    protected boolean isFilteredOutItemNull() {
        return true;
    }

    protected void testContainerSortingAndFiltering(Container.Sortable sortable) {
        Filterable filterable = (Filterable) sortable;

        initializeContainer(sortable);

        // Filter by "contains ab"
        filterable.addContainerFilter(new SimpleStringFilter(
                FULLY_QUALIFIED_NAME, "ab", false, false));

        // Must be able to sort based on PROP1 for this test
        assertTrue(sortable.getSortableContainerPropertyIds().contains(
                FULLY_QUALIFIED_NAME));
View Full Code Here

        t.addListener(new TextChangeListener() {
            SimpleStringFilter filter = null;

            public void textChange(TextChangeEvent event) {
                Filterable f = (Filterable) m_table.getContainerDataSource();

                // Remove old filter
                if (filter != null) {
                    f.removeContainerFilter(filter);
                }
                // Set new filter for the "Name" column
                filter = new SimpleStringFilter(colType, event.getText(), true /* ignoreCase */, false /* onlyMatchPrefix */);

                f.addContainerFilter(filter);
            }
        });

        return t;
    }
View Full Code Here

        t.addListener(new TextChangeListener() {
            SimpleStringFilter filter = null;

            public void textChange(TextChangeEvent event) {
                Filterable f = (Filterable) m_table.getContainerDataSource();

                // Remove old filter
                if (filter != null) {
                    f.removeContainerFilter(filter);
                }
                // Set new filter for the "Name" column
                filter = new SimpleStringFilter(colType, event.getText(), true /* ignoreCase */, false /* onlyMatchPrefix */);

                f.addContainerFilter(filter);
            }
        });

        return t;
    }
View Full Code Here

TOP

Related Classes of com.vaadin.data.Container.Filterable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.