Package com.vaadin.ui

Examples of com.vaadin.ui.Table$ColumnReorderListener


        Button b = new Button("Undefined wide");
        addComponent(b);
        NativeButton b2 = new NativeButton("Undefined wide");
        addComponent(b2);

        Table t = new Table();
        t.addContainerProperty("A", Button.class, null);
        t.setWidth("500px");

        Item i = t.addItem("1");
        i.getItemProperty("A").setValue(new Button("Undef wide"));
        Item i2 = t.addItem("2");
        i2.getItemProperty("A").setValue(new NativeButton("Undef wide"));

        addComponent(t);
    }
View Full Code Here


        return new Integer(2799);
    }

    @Override
    protected void setup() {
        final Table table = new Table();
        final IndexedContainer container = (IndexedContainer) table
                .getContainerDataSource();
        table.addContainerProperty("column1", String.class, "test");

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

        HorizontalLayout hl = new HorizontalLayout();
        hl.addComponent(new Button("Add first", new Button.ClickListener() {
            @Override
View Full Code Here

    private String testPath = "C:/temp/img";

    @Override
    public void setup() {
        Table table = new Table("Documents", new FilesystemContainer(new File(
                testPath)));
        table.setWidth("100%");
        getMainWindow().addComponent(table);
    }
View Full Code Here

    public void init() {

        final LegacyWindow mainWin = new LegacyWindow("Test app");
        setMainWindow(mainWin);

        t = new Table();

        t.addContainerProperty("col1", String.class, "");
        t.addContainerProperty("col2", String.class, "");
        t.addContainerProperty("col3", String.class, "");
View Full Code Here

            super(caption);

            addComponent(new Label(
                    "Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells"));

            Table table = new Table();
            table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
            addComponent(table);
            for (int i = 0; i < 50; i++) {
                table.addItem(new Integer(i));
            }
            table.addContainerProperty("String", String.class, "a string");
            table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE);
            table.addGeneratedColumn("Generated", new ColumnGenerator() {
                @Override
                public Component generateCell(Table source, Object itemId,
                        Object columnId) {
                    return new Label("Item " + itemId);
                }
            });
            table.setCellStyleGenerator(new CellStyleGenerator() {
                @Override
                public String getStyle(Table source, Object itemId,
                        Object propertyId) {
                    if (new Integer(4).equals(itemId)) {
                        if (propertyId == null) {
View Full Code Here

    private Table table;
    private IndexedContainer container;

    @Override
    protected void setup() {
        table = new Table("DefaultItemSorter with custom comparator");
        container = createContainer();
        populateContainer(container);
        container.setItemSorter(new DefaultItemSorter(new Comparator<Object>() {

            @Override
View Full Code Here

        Label source = new Label("label");
        DragAndDropWrapper wrapper = new DragAndDropWrapper(source);
        wrapper.setDragStartMode(DragStartMode.WRAPPER);
        addComponent(wrapper);

        Table target = new Table();
        target.setWidth(100, Unit.PERCENTAGE);
        addComponent(target);
        target.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

public class TableSorting extends TestBase {

    @Override
    public void setup() {
        final Label showID = new Label("");
        final Table testTable = new Table();

        BeanItemContainer<TestItem> cont = new BeanItemContainer<TestItem>(
                TestItem.class);

        for (int i = 0; i < 20; i++) {
            TestItem ti = new TestItem();
            ti.setTestName("Name_" + i);
            cont.addBean(ti);
        }
        testTable.setContainerDataSource(cont);
        testTable.setImmediate(true);
        testTable.setSelectable(true);
        testTable.setMultiSelect(false);
        testTable.setVisibleColumns(new Object[] { "testName" });

        // Handle selection change.
        testTable.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                System.out.println("ValueChanged: "
                        + testTable.getValue().toString());
                showID.setCaption("ID: " + testTable.getValue().toString());
            }
        });
        addComponent(testTable);
        addComponent(showID);
    }
View Full Code Here

        panel = new HorizontalSplitPanel();
        panel.setSecondComponent(label);

        final DatabaseHelper helper = new DatabaseHelper();
        table = new Table();
        table.setSizeFull();
        table.setContainerDataSource(helper.getLargeContainer());
        table.setSelectable(true);
        table.setImmediate(true);
        table.setMultiSelect(true);
View Full Code Here

    @Override
    public void init() {
        setMainWindow(new LegacyWindow("Test window"));
        horizontalSplit.setSizeFull();
        testList = new Table();

        horizontalSplit.setFirstComponent(testList);
        testList.setSizeFull();
        testList.setContainerDataSource(databaseHelper.getTestContainer());
        testList.setSelectable(true);
View Full Code Here

TOP

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

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.