Package com.vaadin.data.util

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


                    item.getItemProperty("icon").setValue(
                            new ThemeResource("../runo/icons/16/folder.png"));
                }

                // Add child items
                item = hwContainer.addItem(itemId);
                item.getItemProperty("name").setValue(hardware[i][j]);
                hwContainer.setParent(itemId, itemId - j);

                hwContainer.setChildrenAllowed(itemId, false);
                if (j == 2) {
View Full Code Here


    }

    private Container generateHierarchicalContainer() {
        HierarchicalContainer cont = new HierarchicalContainer();
        for (int i = 1; i < 6; i++) {
            cont.addItem(i);
            for (int j = 1; j < 3; j++) {
                String id = i + " -> " + j;
                cont.addItem(id);
                cont.setChildrenAllowed(id, false);
                cont.setParent(id, i);
View Full Code Here

        HierarchicalContainer cont = new HierarchicalContainer();
        for (int i = 1; i < 6; i++) {
            cont.addItem(i);
            for (int j = 1; j < 3; j++) {
                String id = i + " -> " + j;
                cont.addItem(id);
                cont.setChildrenAllowed(id, false);
                cont.setParent(id, i);
            }
        }
        return cont;
View Full Code Here

        tree.setContainerDataSource(container);
        tree.setItemIconPropertyId("icon");
        tree.setItemCaptionPropertyId("name");

        for (int i = 0; i < 20; i++) {
            Item bar = container.addItem("bar" + i);
            bar.getItemProperty("name").setValue("Bar" + i);
            bar.getItemProperty("icon").setValue(ICON1);

            if (i > 3) {
                container.setParent("bar" + i, "bar" + (i - 1));
View Full Code Here

            item.getItemProperty("caption").setValue("Number " + i);
            cont.setParent(i, i - 1);
        }

        for (int i = 0; i < 5; i++) {
            Object id = cont.addItem();
            item = cont.getItem(id);
            item.getItemProperty("caption").setValue("0-" + i);
            cont.setParent(id, 0);
        }
View Full Code Here

        // Create containerproperty for icon
        hwContainer.addContainerProperty(hw_PROPERTY_ICON, ThemeResource.class,
                new ThemeResource("../runo/icons/16/document.png"));
        for (int i = 0; i < hardware.length; i++) {
            // Add new item
            item = hwContainer.addItem(itemId);
            // Add name property for item
            item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][0]);
            // Allow children
            hwContainer.setChildrenAllowed(itemId, true);
            itemId++;
View Full Code Here

                if (j == 1) {
                    item.getItemProperty(hw_PROPERTY_ICON).setValue(
                            new ThemeResource("../runo/icons/16/folder.png"));
                }
                // Add child items
                item = hwContainer.addItem(itemId);
                item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][j]);
                hwContainer.setParent(itemId, itemId - j);
                hwContainer.setChildrenAllowed(itemId, false);

                itemId++;
View Full Code Here

    private HierarchicalContainer createContainer() {
        HierarchicalContainer cont = new HierarchicalContainer();
        cont.addContainerProperty("name", String.class, "");

        for (int i = 0; i < 20; i++) {
            Item item = cont.addItem("Item " + i);
            item.getItemProperty("name").setValue("Item " + i);
            cont.setChildrenAllowed("Item " + i, false);

            if (i == 1 || i == 4) {
                cont.setChildrenAllowed("Item " + i, true);
View Full Code Here

            // Add 5 items to item 4
            if (i > 4 && i < 10) {
                cont.setChildrenAllowed("Item " + i, true);

                if (i == 7) {
                    item = cont.addItem("Item 71");
                    item.getItemProperty("name").setValue("Item 71");
                    cont.setParent("Item 71", "Item " + i);
                    cont.setChildrenAllowed("Item 71", false);

                    item = cont.addItem("Item 72");
View Full Code Here

                    item = cont.addItem("Item 71");
                    item.getItemProperty("name").setValue("Item 71");
                    cont.setParent("Item 71", "Item " + i);
                    cont.setChildrenAllowed("Item 71", false);

                    item = cont.addItem("Item 72");
                    item.getItemProperty("name").setValue("Item 72");
                    cont.setParent("Item 72", "Item " + i);
                    cont.setChildrenAllowed("Item 72", true);

                    item = cont.addItem("Item 73");
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.