Package com.vaadin.data.util

Examples of com.vaadin.data.util.IndexedContainer


                }
            }
        };

        public IndexedContainer getContainer() {
            IndexedContainer container = new IndexedContainer();
            container.addContainerProperty(NAME, String.class, null);
            container.addContainerProperty(ID, Integer.class, null);
            for (int i = 0; i < 264; i++) {
                String name = NAME + i;
                int id = i;
                Item item = container.addItem(id);
                item.getItemProperty(NAME).setValue(name);
                item.getItemProperty(ID).setValue(id);
            }
            container.sort(new Object[] { ID }, new boolean[] { true });
            return container;
        }
View Full Code Here


            addComponent(controllerComboBox);
            addComponent(slaveComboBox);
        }

        private void buildAndConfigureComboBoxes() {
            IndexedContainer masterOptionContainer = initMasterOptionContainer();
            controllerComboBox = new Select(CONTROLLER_COMBO_BOX_CAPTION,
                    masterOptionContainer);
            configureMasterOptionDropdown();
            controllerComboBox.addListener(new ControllerUpdatedListener());
View Full Code Here

            buildSlaveDropdown(1);
        }

        private void buildSlaveDropdown(Integer masterId) {
            IndexedContainer slaveOptionContainer = initSlaveOptionContainer(masterId);
            slaveComboBox = new Select(SLAVE_COMBO_BOX_CAPTION,
                    slaveOptionContainer);
            configureSlaveOptionDropdown();
        }
View Full Code Here

        addComponent(shrinkWrapper);
        addComponent(wrapper);
    }

    private Table setupTable() {
        IndexedContainer container = new IndexedContainer();

        container
                .addContainerProperty(
                        "fileName",
                        String.class,
                        "Long enough string to cause a scrollbar when the window is set to a dencently small size.");
        container.addContainerProperty("size", Long.class, 23958l);
        container.addItem();
        container.addItem();
        container.addItem();

        Table table = new Table();
        table.setContainerDataSource(container);
        table.setWidth("100%");
        table.setColumnCollapsingAllowed(true);
View Full Code Here

                    slaveOptionContainer);
            configureSlaveOptionDropdown();
        }

        private IndexedContainer initMasterOptionContainer() {
            IndexedContainer containerToReturn = new IndexedContainer();
            Object defaultValue = null;
            Item itemAdded;

            containerToReturn.addContainerProperty(NAME_PROPERTY_ID,
                    String.class, defaultValue);

            for (Integer optionId : controllerOptionMap.keySet()) {
                itemAdded = containerToReturn.addItem(optionId);
                itemAdded.getItemProperty(NAME_PROPERTY_ID).setValue(
                        controllerOptionMap.get(optionId));
            }

            return containerToReturn;
View Full Code Here

            return containerToReturn;
        }

        private IndexedContainer initSlaveOptionContainer(Integer masterId) {
            IndexedContainer containerToReturn = new IndexedContainer();
            Object defaultValue = null;
            Item itemAdded;
            List<String> options;

            options = slaveOptionMapping.get(controllerOptionMap.get(masterId));
            containerToReturn.addContainerProperty(NAME_PROPERTY_ID,
                    String.class, defaultValue);

            for (String option : options) {
                itemAdded = containerToReturn.addItem(option);
                itemAdded.getItemProperty(NAME_PROPERTY_ID).setValue(option);
            }

            return containerToReturn;
        }
View Full Code Here

     * Creates a testing container for the tests
     *
     * @return A new container with test items
     */
    private Container createTestContainer() {
        IndexedContainer container = new IndexedContainer(Arrays.asList("1",
                new String[] { "2", "3", "4" }));
        return container;
    }
View Full Code Here

        }
        return createContainer(ids, types);
    }

    private static Container createContainer(Object[] ids, Class[] types) {
        IndexedContainer container = new IndexedContainer();
        if (ids.length > types.length) {
            throw new IllegalArgumentException("Too few defined types");
        }
        for (int i = 0; i < ids.length; ++i) {
            container.addContainerProperty(ids[i], types[i], "");
        }

        for (int i = 0; i < 100; i++) {
            Item item = container.addItem("item " + i);
            for (int j = 0; j < ids.length; ++j) {
                Property itemProperty = item.getItemProperty(ids[j]);
                if (types[j] == String.class) {
                    itemProperty.setValue(ids[j].toString() + i);
                } else if (types[j] == BaseClass.class) {
View Full Code Here

     * Creates a container with three properties "col1,col2,col3" with 100 items
     *
     * @return Returns the created table
     */
    private static Container createContainer() {
        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("col1", String.class, "");
        container.addContainerProperty("col2", String.class, "");
        container.addContainerProperty("col3", String.class, "");

        for (int i = 0; i < 100; i++) {
            Item item = container.addItem("item " + i);
            item.getItemProperty("col1").setValue("first" + i);
            item.getItemProperty("col2").setValue("middle" + i);
            item.getItemProperty("col3").setValue("last" + i);
        }

View Full Code Here

        tree3.addItem("parent");
        tree3.addItem("child");
        tree3.setChildrenAllowed("parent", true);
        tree3.setParent("child", "parent");

        tree4 = new Tree("Caption", new IndexedContainer());
        tree4.addItem("parent");
        tree4.addItem("child");
        tree4.setChildrenAllowed("parent", true);
        tree4.setParent("child", "parent");
    }
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.IndexedContainer

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.