Package com.vaadin.ui

Examples of com.vaadin.ui.LegacyWindow


        return 6715;
    }

    @Override
    public void init() {
        mainWindow = new LegacyWindow("Resize test");
        setMainWindow(mainWindow);
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        subWindow = new Window("Sub window", layout);
        subWindow.setHeight("50%");
View Full Code Here


public class Ticket2294 extends LegacyApplication {

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        // setTheme("tests-tickets");
        createUI((AbstractOrderedLayout) w.getContent());
    }
View Full Code Here

*/
public class Ticket5053 extends LegacyApplication {

    @Override
    public void init() {
        LegacyWindow main = new LegacyWindow();
        setMainWindow(main);

        ComboBox combobox = new ComboBox("My ComboBox");

        // Enable null selection
        combobox.setNullSelectionAllowed(true);
        // Add the item that marks 'null' value
        String nullitem = "-- none --";
        combobox.addItem(nullitem);
        // Designate it was the 'null' value marker
        combobox.setNullSelectionItemId(nullitem);

        // Add some other items
        for (int i = 0; i < 10; i++) {
            combobox.addItem("Item " + i);
        }

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

public class Ticket1966_2 extends LegacyApplication {

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);
        w.setContent(new GridLayout(2, 2));

        // Panel p = new Panel("test");
        // p.setWidth(500);
        // p.setHeight(500);
        // p.setContent(new GridLayout(1, 2));
        // p.getLayout().setSizeFull();
        //
        // p.addComponent(new Button("asjkdfhakshdf"));
        // p.addComponent(new Button("öalijgto8aq5"));

        // GridLayout gl = new GridLayout(4, 1);
        // // gl.setCaption("Vertical");
        // gl.setWidth("100%");
        // gl.setHeight(500);

        // addButtons(gl);
        // gl.addComponent(new Label("abc"));
        // p.addComponent(gl);

        // w.getLayout().addComponent(p);
        createUI((Layout) w.getContent());
    }
View Full Code Here

public class Ticket2310 extends LegacyApplication {

    @Override
    public void init() {
        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);

        main.addComponent(new Label("Instructions: change label when panel is "
                + "invisible -> invalid change (with disabled "
                + "flag) is sent to client. Label is grey when panel is shown."));

        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        final Panel p = new Panel(pl);
        p.setStyleName(Reindeer.PANEL_LIGHT);
        main.addComponent(p);
        p.setHeight("100px");

        final Label l = new Label("foobar");

        pl.addComponent(l);

        Button b = new Button("change label");

        b.addListener(new Button.ClickListener() {
            int i = 0;

            @Override
            public void buttonClick(ClickEvent event) {

                l.setValue("foobar " + i++);

            }
        });

        Button b2 = new Button("toggle panel visibility");
        b2.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                p.setVisible(!p.isVisible());
            }
        });

        main.addComponent(b);
        main.addComponent(b2);

    }
View Full Code Here

            public void buttonClick(ClickEvent event) {
                up.getUI().setScrollTop(0);
            }
        });

        setMainWindow(new LegacyWindow(""));
        getMainWindow().addComponent(table);
        getMainWindow().addComponent(up);

    }
View Full Code Here

    final ExternalResource r = new ExternalResource("http://www.google.com");

    @Override
    protected void setup() {
        final LegacyWindow win = getMainWindow();

        addComponent(new TestForWindowOpen());

        addComponent(new Button("Window.open _blank always as popup",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.open(r, "_blank", true);
                    }
                }));

        addComponent(new Button("Window.open _blank NOT always as popup",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.open(r, "_blank", false);
                    }
                }));

        addComponent(new Button("Window.open _new always as popup",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.open(r, "_new", true);
                    }
                }));

        addComponent(new Button("Window.open _new NOT always as popup",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.open(r, "_new", false);
                    }
                }));
        addComponent(new Button(
                "Window execute Javascript window.open(www.google.com, _blank)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.executeJavaScript("window.open(\"http://www.google.com\", \"_blank\");");
                    }
                }));
        addComponent(new Button(
                "Window execute Javascript window.open(www.google.com, _blank, resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        win.executeJavaScript("window.open(\"http://www.google.com\", \"_blank\", \"resizable=yes,menubar=yes,toolbar=yes,directories=yes,location=yes,scrollbars=yes,status=yes\");");
                    }
                }));

    }
View Full Code Here

        this.long2 = long2;
    }

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

        GridLayout layout = new GridLayout(2, 2);
        layout.setSpacing(true);

        TextField f1 = new TextField("Non-immediate/Long text field",
                new MethodProperty<Long>(this, "long1"));
        f1.setImmediate(false);
        f1.setNullSettingAllowed(true);
        TextField f2 = new TextField("Immediate/Long text field",
                new MethodProperty<Long>(this, "long2"));
        f2.setImmediate(true);
        f2.setNullSettingAllowed(true);

        layout.addComponent(f1);
        layout.addComponent(f2);

        w.setContent(layout);
    }
View Full Code Here

public class ExecuteJavaScript extends AbstractTestCase {

    @Override
    public void init() {
        final LegacyWindow mainWindow = new LegacyWindow("Test");
        setMainWindow(mainWindow);

        for (final String script : new String[] { "alert('foo');",
                "window.print()", "document.write('foo')" }) {
            VerticalLayout pl = new VerticalLayout();
            pl.setMargin(true);
            Panel p = new Panel("Example: " + script, pl);
            pl.addComponent(createScriptButton(script));
            mainWindow.addComponent(p);
        }

    }
View Full Code Here

public class Ticket2287 extends Ticket2292 {

    @Override
    public void init() {
        final LegacyWindow main = new LegacyWindow(getClass().getName()
                .substring(getClass().getName().lastIndexOf(".") + 1));
        setMainWindow(main);
        URL url = getURL();
        main.addComponent(new Label(
                "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));

        Label l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue("This is a label with as slow image. <img src=\"" + url
                + "/icon.png\" />");
        main.addComponent(l);

        l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue("This is a label with as slow image. <img src=\"" + url
                + "/icon.png\" />");
        main.addComponent(l);

    }
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.