Package com.vaadin.ui

Examples of com.vaadin.ui.TreeTable$CollapsibleStrategy


*/
public abstract class HierarchicalDataGrid<DTO> extends DataGrid<DTO, TreeTable> {

    @Override
    public void populateGrid(List<DTO> data) {
        populateGrid(data, new TreeTable());
    }
View Full Code Here


        col.addComponents(new Button("Boo"), new InlineDateField(),
                new CheckBox("Far"), new Button("Abc"));

        p.setContent(col);

        TreeTable table = new TreeTable();
        table.setWidth("100%");
        table.setContainerDataSource(ValoThemeUI.generateContainer(200, true));
        Tables.configure(table, true, false, false, true, true, true, false,
                true, false, false, false, false, false, false);
        layout.addComponent(table);

    }
View Full Code Here

                    table.setContainerDataSource(normalContainer);
                    addComponent(table);
                }
                if (hierarchical.getValue() && table instanceof Table) {
                    removeComponent(table);
                    table = new TreeTable();
                    table.setContainerDataSource(hierarchicalContainer);
                    addComponent(table);
                } else if (!hierarchical.getValue()
                        && table instanceof TreeTable) {
                    removeComponent(table);
View Full Code Here

    private static final String CAPTION = "caption";

    @Override
    protected void setup() {
        getMainWindow().getContent().setHeight(null);
        final TreeTable tt = new TreeTable();
        tt.setWidth("400px");
        tt.addContainerProperty(CAPTION, String.class, "");
        for (int i = 0; i < 20; i++) {
            String id = "Root " + i;
            Item item = tt.addItem(id);
            item.getItemProperty(CAPTION).setValue(id);
            addChildren(tt, id, 5, 2);
        }

        tt.setSelectable(true);
        tt.setImmediate(true);

        tt.addListener((ExpandListener) this);
        tt.addListener((CollapseListener) this);
        tt.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                recalculatePageLength(tt);
                tt.markAsDirty();
            }
        });
        addComponent(tt);

        recalculatePageLength(tt);

        Button b = new Button("Set pagelength to 10",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        tt.setPageLength(10);
                    }
                });
        addComponent(b);
        b = new Button("Set pagelength to 20", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                tt.setPageLength(20);
            }
        });
        addComponent(b);
        b = new Button("Set pagelength to 0", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                tt.setPageLength(0);
            }
        });
        addComponent(b);
    }
View Full Code Here

public class TreeTablePartialUpdates extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        TreeTable tt = new TreeTable();
        tt.setContainerDataSource(makeHierarchicalContainer());
        tt.setWidth("300px");
        addComponent(tt);
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    @Override
    protected void setup(VaadinRequest request) {
        table = new TreeTable();
        table.setId(TREE_TABLE);
        table.addContainerProperty("column", String.class, null);
        table.addContainerProperty("delete", Button.class, null);

        for (int i = 0; i < 10; i++) {
View Full Code Here

            populate(folder, 3, 10);

            FilesystemContainer fsc = new FilesystemContainer(folder);

            treeTable = new TreeTable();
            treeTable.addStyleName("table-equal-rowheight");
            treeTable.setWidth("450px");
            treeTable.setHeight("550px");
            treeTable.setContainerDataSource(fsc);
            treeTable.setItemIconPropertyId(FilesystemContainer.PROPERTY_ICON);
View Full Code Here

public class DisappearingComponents extends AbstractTestUI {

    @Override
    public void setup(VaadinRequest request) {
        final TreeTable tt = new TreeTable();
        tt.setSizeUndefined();
        tt.setWidth("100%");
        tt.setImmediate(true);
        tt.setPageLength(0);
        tt.addContainerProperty("i", Integer.class, null);
        tt.addContainerProperty("link", Link.class, null);
        Object[] items = new Object[3];
        for (int i = 0; i < items.length; i++) {
            items[i] = tt
                    .addItem(
                            new Object[] {
                                    i + 1,
                                    new Link(String.valueOf(i + 1),
                                            new ExternalResource(
                                                    "http://www.google.fi")) },
                            null);
        }
        tt.setChildrenAllowed(items[0], false);
        tt.setChildrenAllowed(items[2], false);
        tt.setParent(items[2], items[1]);

        addComponent(tt);
    }
View Full Code Here

public class AddNodesOnExpand extends TestBase {
    private TreeTable treetable;

    @Override
    public void setup() {
        treetable = new TreeTable();
        treetable.setImmediate(true);
        treetable.setWidth("100%");
        treetable.setHeight(null);
        treetable.setPageLength(0);
        treetable.addContainerProperty("foo", String.class, "");
View Full Code Here

import com.vaadin.ui.TreeTable;

public class ChangeDataSourcePageLengthZero extends TestBase {
    @Override
    public void setup() {
        final TreeTable tt = new TreeTable();
        tt.setSizeUndefined();
        tt.setWidth("100%");
        tt.setImmediate(true);
        tt.setPageLength(0);
        setupContainer(tt, 20);
        addComponent(tt);
        Button page1 = new Button("Set new data source (20 items)");
        page1.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                setupContainer(tt, 20);
            }
        });
        Button page2 = new Button("Set new data source (10 items)");
        page2.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                setupContainer(tt, 10);
            }
        });
        Button addButton = new Button("Add item");
        addButton.addListener(new Button.ClickListener() {
            private int i = 1;

            @Override
            public void buttonClick(ClickEvent event) {
                HierarchicalContainer container = (HierarchicalContainer) tt
                        .getContainerDataSource();
                Object itemId = container.addItem();
                container.getContainerProperty(itemId, "i").setValue(i++);
                container.getContainerProperty(itemId, "link").setValue(
                        new Link(String.valueOf(i + 1), new ExternalResource(
View Full Code Here

TOP

Related Classes of com.vaadin.ui.TreeTable$CollapsibleStrategy

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.