Package com.vaadin.ui

Examples of com.vaadin.ui.LegacyWindow


    int selectedPanel = 0;

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

        panelA.setContent(wrapInPanelLayout(new Label(
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")));
        panelB.setContent(wrapInPanelLayout(new Label(
                "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB")));
        panelC.setContent(wrapInPanelLayout(new Label(
                "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC")));

        mainWindow
                .addComponent(new Label(
                        "Inspect transfered data from server to "
                                + "client using firebug (http request / response cycles)."
                                + " See how widgets are re-used,"
                                + " after each panel is once shown in GUI then"
                                + " their contents are not resend."));
        mainWindow.addComponent(buttonNextPanel);
        mainWindow.addComponent(panelA);
        mainWindow.addComponent(panelB);
        mainWindow.addComponent(panelC);

        selectPanel(selectedPanel);

        buttonNextPanel.addListener(new ClickListener() {
            @Override
View Full Code Here


        l.setValue("Started uploading file " + event.getFilename());
    }

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow();
        setTheme("runo");
        w.addComponent(main);
        setMainWindow(w);

    }
View Full Code Here

        final Button restart = new Button("R");
        restart.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                LegacyWindow window = (LegacyWindow) event.getButton().getUI();
                window.getApplication().close();
            }
        });
        main.addComponent(restart);

    }
View Full Code Here

    private final Tree tree = new Tree();

    @Override
    public void init() {
        final LegacyWindow main = new LegacyWindow("Tree filesystem demo");
        setMainWindow(main);

        // Main window contains heading and panel
        main.addComponent(new Label("<h2>Tree demo</h2>", ContentMode.HTML));

        // configure file structure panel
        VerticalLayout explorerLayout = new VerticalLayout();
        explorerLayout.setMargin(true);
        explorerPanel.setContent(explorerLayout);
        main.addComponent(explorerPanel);
        explorerLayout.addComponent(tree);
        explorerPanel.setHeight("400px");

        // "this" handles tree's expand event
        tree.addListener(this);
View Full Code Here

        }
    }

    @Override
    public void init() {
        mainWindow = new LegacyWindow();
        setTheme("tests-components");
        mainWindow.getContent().setSizeFull();
        setMainWindow(mainWindow);
        sp = new HorizontalSplitPanel();
        sp.setSizeFull();
View Full Code Here

    /**
     * Initialize Application. Demo components are added to main window.
     */
    @Override
    public void init() {
        final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
        setMainWindow(mainWindow);

        // Create horizontal ordered layout
        VerticalLayout panelALayout = new VerticalLayout();
        panelALayout.setMargin(true);
        final Panel panelA = new Panel(
                "Panel containing horizontal ordered layout", panelALayout);
        HorizontalLayout layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        // Add layout to panel
        panelALayout.addComponent(layoutA);

        // Create vertical ordered layout
        VerticalLayout panelBLayout = new VerticalLayout();
        panelBLayout.setMargin(true);
        final Panel panelB = new Panel(
                "Panel containing vertical ordered layout", panelBLayout);
        VerticalLayout layoutB = new VerticalLayout();
        // Add 4 random components
        fillLayout(layoutB, componentCountB);
        // Add layout to panel
        panelBLayout.addComponent(layoutB);

        // Create grid layout
        final int gridSize = (int) java.lang.Math.sqrt(componentCountC);
        VerticalLayout panelGLayout = new VerticalLayout();
        panelGLayout.setMargin(true);
        final Panel panelG = new Panel("Panel containing grid layout ("
                + gridSize + " x " + gridSize + ")", panelGLayout);
        GridLayout layoutG = new GridLayout(gridSize, gridSize);
        // Add 12 random components
        fillLayout(layoutG, componentCountC);
        // Add layout to panel
        panelGLayout.addComponent(layoutG);

        // Create TabSheet
        final TabSheet tabsheet = new TabSheet();
        tabsheet.setCaption("Tabsheet, above layouts are added to this component");
        layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        tabsheet.addTab(layoutA, "Horizontal ordered layout", null);
        layoutB = new VerticalLayout();
        // Add 4 random components
        fillLayout(layoutB, componentCountB);
        tabsheet.addTab(layoutB, "Vertical ordered layout", null);
        layoutG = new GridLayout(gridSize, gridSize);
        // Add 12 random components
        fillLayout(layoutG, componentCountC);
        tabsheet.addTab(layoutG, "Grid layout (4 x 2)", null);

        // Create custom layout
        VerticalLayout panelCLayout = new VerticalLayout();
        panelCLayout.setMargin(true);
        final Panel panelC = new Panel("Custom layout with style exampleStyle",
                panelCLayout);
        final CustomLayout layoutC = new CustomLayout("exampleStyle");
        // Add 4 random components
        fillLayout(layoutC, componentCountD);
        // Add layout to panel
        panelCLayout.addComponent(layoutC);

        // Add demo panels (layouts) to main window
        mainWindow.addComponent(panelA);
        mainWindow.addComponent(panelB);
        mainWindow.addComponent(panelG);
        mainWindow.addComponent(tabsheet);
        mainWindow.addComponent(panelC);
    }
View Full Code Here

    public void init() {
        createNewView();
    }

    public void createNewView() {
        final LegacyWindow main = new LegacyWindow("Test window");
        setMainWindow(main);

        main.removeAllComponents();
        main.addComponent(new Label("Testing multiple listeners."));

        //
        // Button listeners
        //
        b1 = new Button("Button 1");
        main.addComponent(b1);

        MyClickListener mutualListener = new MyClickListener("mutual1");

        addListeners(b1, 1);
        b1.addListener(mutualListener);
        b1.addListener(mutualListener);
        b1.addListener(this);
        b1.addListener(mutualListener);
        Button.ClickListener b1Listener = addListeners(b1, 3);
        b1.addListener(mutualListener);
        b1.addListener(this);
        // b1.addListener((ValueChangeListener) this);
        b1.addListener(mutualListener);
        b1.removeListener(b1Listener);
        // remove non-existing listener
        b1.removeListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
            }
        });

        //
        // Select listeners
        //
        s1 = new Select("Select 1");
        main.addComponent(s1);
        s1.setImmediate(true);
        s1.setNewItemsAllowed(true);

        s1.addItem("first");
        s1.addItem("first");
View Full Code Here

    private Window window;

    @Override
    protected void setUp() throws Exception {
        window = new Window();
        new LegacyWindow().addWindow(window);
    }
View Full Code Here

            // main window
        }

        // Try to add the same sub window to another window
        try {
            LegacyWindow w = new LegacyWindow();
            w.addWindow(subWindow);
            assertTrue("Window.addWindow did not throw the expected exception",
                    false);
        } catch (IllegalArgumentException e) {
            // Should throw an exception as it has already been added to the
            // main window
View Full Code Here

    public class TestApp extends LegacyApplication {

        @Override
        public void init() {
            LegacyWindow w = new LegacyWindow("Main window");
            setMainWindow(w);
        }
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.