Package com.vaadin.data.util

Examples of com.vaadin.data.util.HierarchicalContainer.addItem()


            @Override
            public void buttonClick(ClickEvent event) {
                // repopulate the container and expand root item
                container.removeAllItems();
                int parentId = counter++;
                Item parent = container.addItem(parentId);
                tt.setCollapsed(parentId, false);
                parent.getItemProperty("value").setValue(
                        "parent " + (counter++) + "");
                for (int i = 0; i < 4; i++) {
                    int childId = counter++;
View Full Code Here


                tt.setCollapsed(parentId, false);
                parent.getItemProperty("value").setValue(
                        "parent " + (counter++) + "");
                for (int i = 0; i < 4; i++) {
                    int childId = counter++;
                    Item child = container.addItem(childId);
                    child.getItemProperty("value").setValue(childId + "");
                    container.setParent(childId, parentId);
                }
            }
        });
View Full Code Here

                    HierarchicalContainer subtree, Object itemId) {
                Collection<?> children = subtree.getChildren(itemId);
                if (children != null) {

                    for (Object childId : children) {
                        Item addItem = idx.addItem(childId);
                        if (addItem != null) {
                            // did not exist, populate properties
                            Item item = subtree.getItem(itemId);
                            Collection<?> itemPropertyIds = item
                                    .getItemPropertyIds();
View Full Code Here

                        .getContainerPropertyIds();
                for (Object object : containerPropertyIds) {
                    hierarchicalContainer.addContainerProperty(object,
                            idx.getType(object), null);
                }
                hierarchicalContainer.addItem(itemId);
                copyChildren(idx, hierarchicalContainer, itemId);
                return hierarchicalContainer;
            }

            private void copyChildren(HierarchicalContainer source,
View Full Code Here

                    HierarchicalContainer subtree, Object itemId) {
                Collection<?> children = subtree.getChildren(itemId);
                if (children != null) {

                    for (Object childId : children) {
                        Item addItem = idx.addItem(childId);
                        if (addItem != null) {
                            // did not exist, populate properties
                            Item item = subtree.getItem(itemId);
                            Collection<?> itemPropertyIds = item
                                    .getItemPropertyIds();
View Full Code Here

                        .getContainerPropertyIds();
                for (Object object : containerPropertyIds) {
                    hierarchicalContainer.addContainerProperty(object,
                            idx.getType(object), null);
                }
                hierarchicalContainer.addItem(itemId);
                copyChildren(idx, hierarchicalContainer, itemId);
                return hierarchicalContainer;
            }

            private void copyChildren(HierarchicalContainer source,
View Full Code Here

                for (int i = 1; i < data.length; i++) {
                    BeanItem<InventoryObject> item;
                    if (data[i].getClass() == InventoryObject.class) {
                        InventoryObject object = (InventoryObject) data[i];
                        item = new BeanItem<InventoryObject>(object);
                        container.addItem(item);
                        container.setParent(item, parent);
                        container.setChildrenAllowed(item, false);
                    } else {// It's an Object[]
                        Object[] sub = (Object[]) data[i];
                        InventoryObject object = (InventoryObject) sub[0];
View Full Code Here

                        container.setChildrenAllowed(item, false);
                    } else {// It's an Object[]
                        Object[] sub = (Object[]) data[i];
                        InventoryObject object = (InventoryObject) sub[0];
                        item = new BeanItem<InventoryObject>(object);
                        container.addItem(item);
                        container.setParent(item, parent);

                        // Add children recursively
                        put(sub, item, container);
                    }
View Full Code Here

            "../runo/icons/16/document.png");

    private void popuplateTrees() {
        HierarchicalContainer hc = new HierarchicalContainer();
        hc.addContainerProperty("icon", Resource.class, DOC);
        Item addItem = hc.addItem("Fats");
        addItem.getItemProperty("icon").setValue(FOLDER);
        hc.addItem("Tarja");
        hc.setParent("Tarja", "Fats");
        hc.setChildrenAllowed("Tarja", false);
        addItem = hc.addItem("Thins");
View Full Code Here

    private void popuplateTrees() {
        HierarchicalContainer hc = new HierarchicalContainer();
        hc.addContainerProperty("icon", Resource.class, DOC);
        Item addItem = hc.addItem("Fats");
        addItem.getItemProperty("icon").setValue(FOLDER);
        hc.addItem("Tarja");
        hc.setParent("Tarja", "Fats");
        hc.setChildrenAllowed("Tarja", false);
        addItem = hc.addItem("Thins");
        addItem.getItemProperty("icon").setValue(FOLDER);
        addItem = hc.addItem("Anorectic");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.