Package com.vaadin.ui

Examples of com.vaadin.ui.Table$CellStyleGenerator


public class SelectingItemScrollsRight extends TestBase {

    @Override
    protected void setup() {
        Table table = new Table();
        table.setSelectable(true);
        table.setWidth("300px");
        table.setColumnWidth("Column", 500);
        table.addGeneratedColumn("Column", new Table.ColumnGenerator() {
            @Override
            public Component generateCell(Table source, Object itemId,
                    Object columnId) {
                return new Label(
                        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            }
        });

        for (int i = 0; i < 50; i++) {
            table.addItem();
        }

        addComponent(table);
    }
View Full Code Here


            dnd.setDragStartMode(DragStartMode.COMPONENT);
        }

        {
            final Table tbl = new Table();
            tbl.addContainerProperty("column", String.class,
                    "drag/drop to/from here");
            for (int i = 0; i < 5; i++) {
                tbl.addItem();
            }
            addComponent(tbl);
            tbl.setDragMode(TableDragMode.ROW);
            tbl.setDropHandler(new DropHandler() {

                @Override
                public AcceptCriterion getAcceptCriterion() {
                    return AcceptAll.get();
                }

                @Override
                public void drop(DragAndDropEvent event) {
                    tbl.getItem(tbl.addItem()).getItemProperty("column")
                            .setValue("You dropped something");
                }
            });
            final CheckBox enabled = new CheckBox("Enabled", true);
            addComponent(enabled);
            enabled.setImmediate(true);
            enabled.addListener(new ValueChangeListener() {

                @Override
                public void valueChange(ValueChangeEvent event) {
                    tbl.setEnabled(enabled.booleanValue());
                }
            });
        }
    }
View Full Code Here

    }

    @Override
    protected void setup(VaadinRequest request) {
        getSession().setConverterFactory(new MyConverterFactory());
        Table t = new Table();
        t.addContainerProperty("String column", String.class, "");
        t.addContainerProperty("Integer column", Integer.class, "");
        t.addItem(new Object[] { "Second column is 1", 1 }, "item1");
        t.addItem(new Object[] { "Second column is 4589", 4589 }, "item2");

        addComponent(t);
    }
View Full Code Here

                        sort(indexedContainer);
                    }
                });
        l.addComponent(modify);

        Table t = new Table("Table with indexed container", indexedContainer);

        l.addComponent(t);
    }
View Full Code Here

@SuppressWarnings("serial")
public class MultiSelectWithNotIdentityEqualIds extends TestBase {

    @Override
    protected void setup() {
        final Table t = new Table();
        t.setContainerDataSource(getDS());
        t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
        t.setMultiSelect(true);
        t.setSelectable(true);
        t.setImmediate(true);
        t.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                Notification.show("Selected: " + event.getProperty());

            }
View Full Code Here

        return new Integer(1061);
    }

    @Override
    protected void setup() {
        table = new Table();
        try {
            container = new BeanItemContainer<TestBean>(TestBean.class);
            table.setContainerDataSource(container);

            table.setWidth(300, Sizeable.UNITS_PIXELS);
View Full Code Here

            SQLContainer container = new LimitedSQLContainer(query);

            final VerticalLayout rootLayout = new VerticalLayout();

            final Table table = new Table();
            table.setContainerDataSource(container);
            table.setCurrentPageFirstItemIndex(300);
            rootLayout.addComponent(table);

            table.setImmediate(true);

            rootLayout.addComponent(new Button("GOTO 200", new ClickListener() {

                @Override
                public void buttonClick(ClickEvent event) {
                    table.setCurrentPageFirstItemIndex(200);
                }
            }));

            setContent(rootLayout);
View Full Code Here

        return 5022;
    }

    @Override
    protected void setup() {
        final Table t = new Table();
        t.setSizeFull();
        t.addContainerProperty("name", String.class, "NA");

        for (Integer i = 0; i < COLS; i++) {
            t.addContainerProperty(i, Integer.class, Integer.valueOf(0));
        }
        t.addItem("1").getItemProperty("name").setValue("Ares");
        t.addItem("2").getItemProperty("name").setValue("Bob");
        t.addItem("3").getItemProperty("name").setValue("Coral");
        t.addItem("4").getItemProperty("name").setValue("David");
        t.addItem("5").getItemProperty("name").setValue("Emma");

        addComponent(t);
    }
View Full Code Here

        return 4206;
    }

    @Override
    public void init() {
        Table table = new Table();
        table.setPageLength(50);

        setMainWindow(new LegacyWindow(""));
        getMainWindow().getContent().setSizeUndefined();

        Component l2 = null;
View Full Code Here

        return new Integer(2809);
    }

    @Override
    protected void setup() {
        table = new Table();
        container = (IndexedContainer) table.getContainerDataSource();

        table.setWidth(300, Sizeable.UNITS_PIXELS);
        table.setSelectable(true);
        table.setMultiSelect(false);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Table$CellStyleGenerator

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.