Package com.vaadin.ui

Examples of com.vaadin.ui.Table


    @Override
    protected void setup() {

        final HorizontalSplitPanel split = new HorizontalSplitPanel();

        final Table table = new Table();
        table.addContainerProperty("name", String.class, "");
        table.addContainerProperty("value", String.class, "");

        table.addItem(new Object[] { "test1", "val1" }, "test1");
        table.addItem(new Object[] { "test2", "val2" }, "test2");
        table.addItem(new Object[] { "test3", "val3" }, "test3");
        table.addItem(new Object[] { "test4", "val4" }, "test4");
        table.addItem(new Object[] { "test5", "val5" }, "test5");
        table.addItem(new Object[] { "test6", "val6" }, "test6");
        table.addItem(new Object[] { "test7", "val7" }, "test7");
        table.addItem(new Object[] { "test8", "val8" }, "test8");
        table.addItem(new Object[] { "test9", "val9" }, "test9");
        table.setSelectable(true);
        table.setImmediate(true);
        table.setSizeFull();
        table.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if (table.getValue() == null) {
                    split.setSplitPosition(100, Sizeable.UNITS_PERCENTAGE);
                } else {
                    split.setSplitPosition(20, Sizeable.UNITS_PERCENTAGE);
                }
            }
View Full Code Here


    public void init() {

        final LegacyWindow mainWin = new LegacyWindow();
        setMainWindow(mainWin);

        Table t = new Table();

        IndexedContainer c = new IndexedContainer();

        c.addItem("foo");

        c.addContainerProperty("testcol1", Integer.class, new Integer(7));
        c.addContainerProperty("testcol2", String.class, "str");
        c.addContainerProperty("testcol3", String.class, null);

        c.addItem("bar");

        t.setContainerDataSource(c);

        t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);

        mainWin.addComponent(new Label(
                "Both rows in table should have same data (default values)"));

        mainWin.addComponent(t);
View Full Code Here

    private Table table;

    @Override
    protected void setup(VaadinRequest request) {
        table = new Table();
        IndexedContainer ic = new IndexedContainer();
        populate(ic);
        table.setContainerDataSource(ic);
        table.setPageLength(20);
        table.setSelectable(true);
View Full Code Here

import com.vaadin.ui.Table;

public class ColumnExpandWithFixedColumns extends TestBase {

    private Table createTable() {
        Table t = new Table();
        t.addContainerProperty("id", Integer.class, null);
        t.addContainerProperty("txt", Component.class, null);
        t.addContainerProperty("button", Button.class, null);
        t.setColumnWidth("id", 30);
        t.setColumnWidth("button", 200);
        t.setColumnExpandRatio("txt", 10);// This column should be 400px wide.
        t.setSelectable(true);
        t.setSizeFull();

        for (int i = 0; i < 10; i++) {
            t.addItem(new Object[] { i, new Label("test " + i),
                    new Button("Button " + i) }, i);
        }

        return t;
View Full Code Here

import com.vaadin.ui.Table;

public class EditableTableFocus extends TestBase {
    @Override
    public void setup() {
        Table table = new Table();

        table.addContainerProperty("TextField", String.class, null);
        table.setColumnWidth("TextField", 150);
        for (int i = 1; i < 100; i++) {
            table.addItem(new String[] { "" }, new Integer(i));
        }
        table.setEditable(true);

        addComponent(table);
    }
View Full Code Here

        main.getContent().setSizeFull();

        TabSheet ts = new TabSheet();
        ts.setSizeFull();

        final Table t = TestForTablesInitialColumnWidthLogicRendering
                .getTestTable(7, 2000);
        t.setSizeFull();
        ts.addTab(t, "Table, scrollins should not flash", null);

        final Label testContent = new Label(
                "TabSheet by default uses caption, icon, errors etc. from Components. ");

        testContent.setCaption("Introduction to test");

        ts.addTab(testContent);

        final VerticalLayout actions = new VerticalLayout();

        actions.setCaption("Test actions");

        ts.addTab(actions);

        Button b;

        b = new Button(
                "change introduction caption (should add * to tab name)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        testContent.setCaption(testContent.getCaption() + "*");
                    }
                });
        actions.addComponent(b);

        b = new Button("change tab caption (should add * to tab name)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        actions.setCaption(actions.getCaption() + "*");
                    }
                });

        actions.addComponent(b);

        final UserError e = new UserError("Test error");

        b = new Button("Toggle error", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (testContent.getComponentError() == null) {
                    testContent.setComponentError(e);
                } else {
                    testContent.setComponentError(null);
                }
            }
        });
        actions.addComponent(b);

        b = new Button("Change table caption", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                t.setCaption(t.getCaption() + "*");
            }
        });
        actions.addComponent(b);

        b = new Button("Toggle Table error", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (t.getComponentError() == null) {
                    t.setComponentError(e);
                } else {
                    t.setComponentError(null);
                }
            }
        });

        actions.addComponent(b);
View Full Code Here

     * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
     * VaadinRequest)
     */
    @Override
    protected void setup(VaadinRequest request) {
        final Table table = new Table("Test table", buildContainer());
        table.setSizeFull();
        addComponent(table);
        Button sortButton = new Button("Sort", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.sort(new Object[] { "val1" }, new boolean[] { false });
            }
        });
        addComponent(sortButton);
    }
View Full Code Here

        public TabComposite() {
            Layout mainLayout = new VerticalLayout();
            addComponent(mainLayout);
            setCompositionRoot(mainLayout);

            Component table = new Table();
            table.setWidth("100%");
            table.setId(TABLE);
            mainLayout.addComponent(table);
        }
View Full Code Here

    protected Integer getTicketNumber() {
        return 5681;
    }

    private Table createTable() {
        Table table = new Table() {
            @Override
            public void setColumnCollapsed(Object propertyId, boolean collapsed)
                    throws IllegalStateException {
                ++counter;
                label.setValue(String.valueOf(counter));
                super.setColumnCollapsed(propertyId, collapsed);
            }
        };
        table.setWidth("400px");
        table.setHeight("100px");
        table.setPageLength(100);
        table.setColumnCollapsingAllowed(true);
        table.setImmediate(true);
        table.addContainerProperty("p1", String.class, null);
        table.addContainerProperty("p2", String.class, null);
        table.addContainerProperty("p3", String.class, null);
        table.addContainerProperty("p4", String.class, null);

        for (int i = 0; i < 10; i++) {
            table.addItem(new Object[] { "a" + i, "b" + i, "c" + i, "X" + i },
                    "" + i);
        }
        return table;
    }
View Full Code Here

        TextField tf1 = new TextField("Tab 1");
        tf1.setValue("Field 1");
        tf1.setSizeFull();

        Table t = new Table("Table");
        t.addContainerProperty(P1, String.class, "");
        t.setSizeFull();

        TabSheet tabSheet = new TabSheet();
        tabSheet.setWidth("300px");
        tabSheet.setHeight("300px");
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Table

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.