Package com.vaadin.ui

Examples of com.vaadin.ui.LegacyWindow


    private FormLayout layout1;
    private FormLayout layout2;

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        setTheme("tests-tickets");
        w.getContent().setSizeUndefined();

        layout1 = new FormLayout();
        layout1.setSizeUndefined();
        layout1.setStyleName("borders");
        Label label = new Label(
                "This should not be wider than this label + reserved error space");
        label.setCaption("A caption");
        layout1.addComponent(label);
        w.addComponent(layout1);

        layout2 = new FormLayout();
        layout2.setWidth("500px");
        layout2.setStyleName("borders");
        label = new Label("This should be 500px wide");
        label.setCaption("A caption");
        layout2.addComponent(label);
        w.addComponent(layout2);

        Button b = new Button("Swap", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (layout1.getWidth() < 0.0) {
                    layout1.setWidth("500px");
                    layout2.setWidth(null);
                } else {
                    layout1.setWidth(null);
                    layout2.setWidth("500px");
                }
            }

        });
        w.addComponent(b);
    }
View Full Code Here


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

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

        Component l2 = null;
        for (int i = 0; i < 10; i++) {
            l2 = l("X" + i);
View Full Code Here

    public static final String pageButtonStyle = "test-page-change";

    @Override
    public void init() {

        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);

        setTheme("tests-tickets");
        GridLayout gl = new GridLayout(5, 5);

        gl.setStyleName("borders");

        gl.addComponent(new Label("0,0"), 0, 0);
        gl.addComponent(new Label("0,1"), 0, 1);
        gl.addComponent(new Label("0,2"), 0, 2);
        gl.addComponent(new Label("0,3"), 0, 3);
        gl.addComponent(new Label("0,4"), 0, 4);
        gl.addComponent(new Label("1,0"), 1, 0);
        gl.addComponent(new Label("2,0"), 2, 0);
        gl.addComponent(new Label("3,0"), 3, 0);
        gl.addComponent(new Label("4,0"), 4, 0);

        gl.addComponent(new Label("1,4"), 1, 4);
        gl.addComponent(new Label("2,4"), 2, 4);
        gl.addComponent(new Label("3,4"), 3, 4);
        gl.addComponent(new Label("4,4"), 4, 4);

        gl.addComponent(new Label("1-1 -> 2-2"), 1, 1, 2, 2);
        gl.addComponent(new Label("3,1"), 3, 1);
        gl.addComponent(new Label("3,2"), 3, 2);
        gl.addComponent(new Label("3,3"), 3, 3);

        main.addComponent(gl);

        // create grid
        GridLayout grid = new GridLayout(7, 7);

        grid.setStyleName("borders");

        // add upper row
        Button up = new Button("UP");

        up.setStyleName(pageButtonStyle);
        grid.addComponent(up, 0, 0);

        Label space = new Label();
        space.setStyleName(spacerStyle);
        grid.addComponent(space, 1, 0);

        Button single = null;
        String headingStyle = "foo";
        for (int i = 1; i < grid.getColumns() - 2; i++) {
            single = new Button(Integer.toString(i));
            single.setStyleName(headingStyle);
            grid.addComponent(single, i + 1, 0);
        }

        space = new Label();
        space.setStyleName(spacerStyle);
        grid.addComponent(space, grid.getColumns() - 1, 0);

        // middle rows
        char rowChar = 'A';
        for (int i = 1; i < grid.getRows() - 1; i++) {
            space = new Label(Character.toString(rowChar++));
            space.setStyleName(colHeadStyle);
            grid.addComponent(space, 0, i);

            space = new Label();
            space.setStyleName(spacerStyle);
            grid.addComponent(space, 1, i);

            space = new Label();
            space.setStyleName(spacerStyle);
            grid.addComponent(space, grid.getColumns() - 1, i);
        }

        // bottom row
        Button dn = new Button("DOWN");
        dn.setStyleName(pageButtonStyle);
        grid.addComponent(dn, 0, grid.getRows() - 1);

        space = new Label();
        space.setStyleName(spacerStyle);
        grid.addComponent(space, 1, grid.getRows() - 1);

        for (int i = 1; i < grid.getColumns() - 2; i++) {
            single = new Button(Integer.toString(i));
            single.setStyleName(headingStyle);
            grid.addComponent(single, i + 1, grid.getRows() - 1);
        }

        space = new Label();
        space.setStyleName(spacerStyle);
        grid.addComponent(space, grid.getColumns() - 1, grid.getRows() - 1);

        main.addComponent(grid);
    }
View Full Code Here

    private Table t;

    @Override
    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, "");

        t.addItem(new Object[] { "jep", "foo", "bar" }, "1");
        t.addItem(new Object[] { "jep", "foo", "bar" }, "2");
        t.addItem(new Object[] { "jep", "foo", "bar" }, "3");

        t.setVisibleColumns(new Object[] { "col1", "col2" });

        t.addItem(new Object[] { "foo", "bar" }, "4");

        // workaround to add item with all values
        Item i = t.addItem("5");
        i.getItemProperty("col1").setValue("jep");
        i.getItemProperty("col2").setValue("foo");
        i.getItemProperty("col3").setValue("bar");

        mainWin.addComponent(t);

        Button b = new Button("Toggle col3");
        b.addListener(new Button.ClickListener() {
            boolean visible = false;

            @Override
            public void buttonClick(ClickEvent event) {
                visible = !visible;
                if (visible) {
                    t.setVisibleColumns(new Object[] { "col1", "col2", "col3" });

                } else {
                    t.setVisibleColumns(new Object[] { "col1", "col2" });

                }

            }
        });

        mainWin.addComponent(b);

    }
View Full Code Here

public class Ticket2901 extends LegacyApplication {

    @Override
    public void init() {

        final LegacyWindow mainWin = new LegacyWindow(
                "Test app to break layout in IE6");
        setMainWindow(mainWin);

        VerticalSplitPanel sp = new VerticalSplitPanel();

        VerticalLayout l = new VerticalLayout();
        for (int i = 0; i < 100; i++) {
            l.addComponent(new Label("Label" + i));
        }
        sp.setFirstComponent(l);

        mainWin.setContent(sp);

    }
View Full Code Here

import com.vaadin.ui.VerticalLayout;

public class TableQueryWithNonUniqueFirstPrimaryKey extends LegacyApplication {
    @Override
    public void init() {
        LegacyWindow mainWindow = new LegacyWindow("Test Application");
        setMainWindow(mainWindow);

        try {
            JDBCConnectionPool connectionPool = new SimpleJDBCConnectionPool(
                    "org.hsqldb.jdbc.JDBCDriver",
                    "jdbc:hsqldb:mem:sqlcontainer", "SA", "", 2, 20);

            createTestTable(connectionPool);
            insertTestData(connectionPool);

            TableQuery q = new TableQuery("MYTABLE2", connectionPool);
            q.setVersionColumn("VERSION");
            SQLContainer myContainer = new SQLContainer(q);
            // Uncommenting these works around the issue
            // myContainer.addOrderBy(new OrderBy("PFX", true));
            // myContainer.addOrderBy(new OrderBy("NUMERO", true));
            myContainer.removeAllContainerFilters();
            myContainer.addContainerFilter(new Equal("PFX", "C"));

            VerticalLayout layout = new VerticalLayout();
            mainWindow.setContent(layout);

            final ComboBox myCombo = new ComboBox("MyCaption");
            myCombo.setDescription("Description");
            myCombo.setContainerDataSource(myContainer);
            myCombo.setItemCaptionPropertyId("MYFIELD");
View Full Code Here

    ProgressIndicator proggress = new ProgressIndicator();
    Button process = new Button("Mass insert");

    @Override
    public void init() {
        setMainWindow(new LegacyWindow("SQLContainer Test", buildLayout()));

        process.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                MassInsert mi = new MassInsert();
View Full Code Here

public class Ticket2432 extends LegacyApplication {

    @Override
    public void init() {

        LegacyWindow w = new LegacyWindow();
        setMainWindow(w);
        w.getContent().setSizeFull();
        ((SpacingHandler) w.getContent()).setSpacing(true);

        Layout layout = new GridLayout(3, 3);
        populateLayout(layout);
        w.addComponent(layout);
        layout = new HorizontalLayout();
        populateLayout(layout);
        w.addComponent(layout);

    }
View Full Code Here

public class Ticket2283 extends LegacyApplication {

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);

        GridLayout gl = new GridLayout(2, 2);
        gl.setSizeUndefined();

        gl.addComponent(new Label(
                "Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf"));
        gl.addComponent(new Label("Label 2 abc abc abc "));
        Label l = new Label("Colspan2, align right");
        gl.addComponent(l, 0, 1, 1, 1);
        gl.setComponentAlignment(l, Alignment.TOP_RIGHT);
        w.setContent(gl);

    }
View Full Code Here

    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);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.LegacyWindow

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.