Package com.vaadin.tests.containers.sqlcontainer

Source Code of com.vaadin.tests.containers.sqlcontainer.SqlcontainertableApplication

package com.vaadin.tests.containers.sqlcontainer;

import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.server.LegacyApplication;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
import com.vaadin.ui.Table;

public class SqlcontainertableApplication extends LegacyApplication {
    private LegacyWindow mainWindow;
    private Table table;
    private HorizontalSplitPanel panel;
    private Label label = new Label();

    @Override
    public void init() {
        mainWindow = new LegacyWindow("SQLContainer Test");
        setMainWindow(mainWindow);
        mainWindow.getContent().setSizeFull();

        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);
        table.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                label.setValue(table.getValue().toString());
            }
        });

        panel.setSizeFull();
        panel.addComponent(table);

        mainWindow.addComponent(panel);

    }

}
TOP

Related Classes of com.vaadin.tests.containers.sqlcontainer.SqlcontainertableApplication

TOP
Copyright © 2018 www.massapi.com. 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.