Package com.vaadin.ui

Examples of com.vaadin.ui.Panel


        addWindow(w);
    }

    private Panel createPanel() {
        Panel p = new Panel();

        VerticalLayout content = new VerticalLayout();
        p.setContent(content);
        content.setHeight("500px");

        List<String> items = new ArrayList<String>();
        items.add("1");
        items.add("2");
View Full Code Here


        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

                    }
                }));

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel("scrollable panel", panelLayout);
        panel.setHeight(400, Panel.UNITS_PIXELS);
        panel.setScrollLeft(50);
        panel.setScrollTop(50);
        panelLayout.setSizeUndefined();
        layout.addComponent(l("Spacer", 500, 500));

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

    }

    private ComponentContainer buildMainLayout() {
        contentLayout.addComponent(new Label("Content lives here"));

        Panel contentScroller = new Panel(contentLayout);
        contentScroller.setStyleName(Reindeer.PANEL_LIGHT);
        contentScroller.setSizeFull();

        TextArea performanceReportArea = new TextArea();
        performanceReportArea.setWidth("200px");
        TestUtils.installPerformanceReporting(performanceReportArea);
View Full Code Here

            columns.addComponent(right);
            columns.setHeight(null);
            columns.setWidth("100%");

            if (wrapInPanel) {
                Panel panel = new Panel("Data " + i, columns);
                panel.setWidth("100%");
                panel.setHeight(null);

                contentLayout.addComponent(panel);
            } else {
                contentLayout.addComponent(columns);
            }
View Full Code Here

        createUI((AbstractOrderedLayout) w.getContent());
    }

    private void createUI(AbstractOrderedLayout layout) {
        VerticalLayout ol;
        Panel p;
        ComboBox cb;

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox without width");
        // p.setWidth("100px");
        cb = new ComboBox();
        // cb.setCaption("A combobox");
        // cb.setWidth("100%");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox without width with caption");
        // p.setWidth("100px");
        cb = new ComboBox();
        cb.setCaption("A combobox");
        // cb.setWidth("100px");
        ol.addComponent(cb);
        layout.addComponent(p);

        //
        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 100px wide");
        // p.setWidth("100px");
        cb = new ComboBox();
        // cb.setCaption("A combobox");
        cb.setWidth("100px");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 100px wide with caption");
        // p.setWidth("100px");
        cb = new ComboBox();
        cb.setCaption("A combobox");
        cb.setWidth("100px");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 500px wide");
        // p.setWidth("500px");
        cb = new ComboBox();
        // cb.setCaption("A combobox");
        cb.setWidth("500px");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 500px wide with caption");
        // p.setWidth("500px");
        cb = new ComboBox();
        cb.setCaption("A combobox");
        cb.setWidth("500px");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 100% wide");
        p.setWidth("200px");
        ol.setWidth("100%");
        cb = new ComboBox();
        // cb.setCaption("A combobox");
        cb.setWidth("100%");
        ol.addComponent(cb);
        layout.addComponent(p);

        ol = new VerticalLayout();
        p = new Panel(ol);
        p.setCaption("Combobox 100% wide with caption");
        p.setWidth("200px");
        ol.setWidth("100%");
        cb = new ComboBox();
        cb.setCaption("A combobox");
        cb.setWidth("100%");
        ol.addComponent(cb);
View Full Code Here

        setTheme("runo");
        main = new LegacyWindow("PopupView test");
        setMainWindow(main);
        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel("PopupTest", panelLayout);

        // First test component
        final ObjectProperty<String> prop = new ObjectProperty<String>(
                "fooTextField");

        PopupView.Content content = new PopupView.Content() {
            @Override
            public String getMinimizedValueAsHTML() {
                return String.valueOf(prop.getValue());
            }

            @Override
            public Component getPopupComponent() {
                return new TextField("Edit foo", prop);
            }
        };

        PopupView pe = new PopupView(content);
        pe.setDescription("Click to edit");
        panelLayout.addComponent(pe);

        // Second test component
        PopupView pe2 = new PopupView("fooLabel", new Label("Foooooooooo..."));
        pe2.setDescription("Click to view");
        panelLayout.addComponent(pe2);

        // Third test component
        final ObjectProperty<StringBuffer> prop2 = new ObjectProperty<StringBuffer>(
                new StringBuffer("Text for button"));

        class myButton extends Button {
            public myButton() {
                super("Reverse the property");
                this.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        StringBuffer getContents = prop2.getValue();
                        getContents.reverse();

                    }
                });
            }
        }

        VerticalLayout panel2Layout = new VerticalLayout();
        panel2Layout.setMargin(true);
        final Panel panel2 = new Panel("Editor with a button", panel2Layout);
        panel2Layout.addComponent(new myButton());
        PopupView.Content content2 = new PopupView.Content() {
            @Override
            public String getMinimizedValueAsHTML() {
                return String.valueOf(prop2.getValue());
            }

            @Override
            public Component getPopupComponent() {
                return panel2;
            }
        };

        PopupView p3 = new PopupView(content2);
        panelLayout.addComponent(p3);

        // Fourth test component
        VerticalLayout panel3Layout = new VerticalLayout();
        panel3Layout.setMargin(true);
        final Panel panel3 = new Panel("Editor popup for a property",
                panel3Layout);
        TextField tf2 = new TextField("TextField for editing a property");
        final ObjectProperty<String> op = new ObjectProperty<String>(
                "This is property text.");
        tf2.setPropertyDataSource(op);
View Full Code Here

        // }
        // });
        // layout.addComponent(sw);

        Layout ol = new GridLayout(1, 2);
        p = new Panel("Panel", ol);
        p.setSizeFull();
        Label l = new Label("Spacer");
        l.setHeight("400px");
        ol.addComponent(l);
View Full Code Here

        VerticalLayout lo = new VerticalLayout();
        lo.setSizeFull();
        mainWin.setContent(lo);

        final Panel p = createMultilevelPanel(5, (Panel) null);

        Button b = new Button("Toggle parent level size");
        lo.addComponent(b);
        b.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (p.getWidth() > 0) {
                    p.setSizeUndefined();
                } else {
                    p.setSizeFull();
                }
            }
        });

        lo.addComponent(p);
View Full Code Here

    private Panel createMultilevelPanel(int i, Panel panel) {
        if (panel == null) {
            VerticalLayout panelLayout = new VerticalLayout();
            panelLayout.setMargin(true);
            panel = new Panel("Panel level " + i, panelLayout);
            panel.setSizeFull();
            panelLayout.setSizeFull();
        }
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        pl.setSizeFull();
        Panel p = new Panel("Panel level " + i--, pl);
        p.setSizeFull();
        pl.addComponent(p);
        if (i > 0) {
            createMultilevelPanel(i, p);
        }
        return panel;
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Panel

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.