Package com.vaadin.data

Examples of com.vaadin.data.Container$PropertySetChangeNotifier


     */

    @Override
    public void sort(Object[] propertyId, boolean[] ascending)
            throws UnsupportedOperationException {
        final Container c = getContainerDataSource();
        if (c instanceof Container.Sortable) {
            final int pageIndex = getCurrentPageFirstItemIndex();
            boolean refreshingPreviouslyEnabled = disableContentRefreshing();
            ((Container.Sortable) c).sort(propertyId, ascending);
            setCurrentPageFirstItemIndex(pageIndex);
View Full Code Here


     * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
     */

    @Override
    public Collection<?> getSortableContainerPropertyIds() {
        final Container c = getContainerDataSource();
        if (c instanceof Container.Sortable && isSortEnabled()) {
            return ((Container.Sortable) c).getSortableContainerPropertyIds();
        } else {
            return Collections.EMPTY_LIST;
        }
View Full Code Here

        Button b = new Button("Truncate to 20 rows");
        b.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {

                Container containerDataSource = t.getContainerDataSource();
                Object[] itemIds = containerDataSource.getItemIds().toArray();
                @SuppressWarnings("unused")
                int c = 0;
                for (int i = 0; i < itemIds.length; i++) {
                    if (i > 19) {
                        containerDataSource.removeItem(itemIds[i]);
                    }
                }
            }
        });
View Full Code Here

                    new_name.setContainerDataSource(TestForTablesInitialColumnWidthLogicRendering
                            .getTestTable(5, 100).getContainerDataSource());

                } else {
                    AbstractSelect new_name = (AbstractSelect) c;
                    Container cont = TestForTablesInitialColumnWidthLogicRendering
                            .getTestTable(2, 8).getContainerDataSource();
                    new_name.setContainerDataSource(cont);
                    new_name.setItemCaptionPropertyId(cont
                            .getContainerPropertyIds().iterator().next());

                }
            } else if (c instanceof ComponentContainer) {
                ComponentContainer new_name = (ComponentContainer) c;
View Full Code Here

                            (InventoryObject) sourceItemId);
                }

                // Remove the item from the source container and
                // add it to the tree's container
                Container sourceContainer = t.getSourceContainer();
                sourceContainer.removeItem(sourceItemId);
                tree.addItem(beanItem);
                InventoryObject bean = (InventoryObject) beanItem.getBean();
                tree.setChildrenAllowed(beanItem, bean.isContainer());

                // Drop right on an item -> make it a child
View Full Code Here

                 * DataBoundTransferrable
                 */
                DataBoundTransferable tr = (DataBoundTransferable) event
                        .getTransferable();
                Object itemId = tr.getItemId();
                Container sourceContainer = tr.getSourceContainer();
                if (tr.getSourceComponent() != tree1) {
                    // if the source is from table (not from tree1 itself),
                    // transfer Name property and use it as an identifier in
                    // tree1
                    Object nameValue = sourceContainer.getItem(itemId)
                            .getItemProperty("Name").getValue();
                    String name = (null != nameValue) ? nameValue.toString()
                            : null;

                    tree1.addItem(name);
                    tree1.setChildrenAllowed(name, false);

                    /*
                     * Remove the item from table
                     */
                    sourceContainer.removeItem(itemId);

                    itemId = name;

                }

View Full Code Here

        table.setImmediate(true);
        table.setMultiSelect(true);
        table.setSizeFull();
        table.setSelectable(true);

        Container ds = new IndexedContainer();
        ds.addContainerProperty("column", Integer.class, null);
        for (int i = 0; i < 500; i++) {
            Item item = ds.addItem(i);
            item.getItemProperty("column").setValue(i);
        }
        table.setContainerDataSource(ds);

        return table;
View Full Code Here

        layout.setMargin(true);
        setContent(layout);
        SlowComboBox comboBox = new SlowComboBox();
        comboBox.setNullSelectionAllowed(false);
        comboBox.setImmediate(true);
        Container container = createContainer();
        comboBox.setContainerDataSource(container);
        comboBox.setNewItemsAllowed(true);
        comboBox.setFilteringMode(FilteringMode.CONTAINS);
        layout.addComponent(comboBox);
        layout.addComponent(new TextField());
View Full Code Here

            @Override
            public void drop(DragAndDropEvent dropEvent) {
                // criteria verify that this is safe
                DataBoundTransferable t = (DataBoundTransferable) dropEvent
                        .getTransferable();
                Container sourceContainer = t.getSourceContainer();
                Object sourceItemId = t.getItemId();
                System.out.println(sourceItemId);

                AbstractSelectTargetDetails dropData = ((AbstractSelectTargetDetails) dropEvent
                        .getTargetDetails());
                Object targetItemId = dropData.getItemIdOver();

                // move item from table to category'
                tree.addItem(sourceItemId);
                tree.setParent(sourceItemId, targetItemId);
                tree.setChildrenAllowed(sourceItemId, false);
                sourceContainer.removeItem(sourceItemId);

            }
        });

        tree.addItem("Item 1");
View Full Code Here

        addComponent(row);

        Tree tree = new Tree();
        tree.setSelectable(true);
        tree.setMultiSelect(true);
        Container generateContainer = ValoThemeUI.generateContainer(10, true);
        tree.setContainerDataSource(generateContainer);
        tree.setDragMode(TreeDragMode.NODE);
        row.addComponent(tree);
        tree.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
        tree.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
        tree.expandItem(generateContainer.getItemIds().iterator().next());

        tree.setDropHandler(new DropHandler() {
            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
View Full Code Here

TOP

Related Classes of com.vaadin.data.Container$PropertySetChangeNotifier

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.