Package com.vaadin.ui

Examples of com.vaadin.ui.Panel


        HorizontalLayout hl = new HorizontalLayout();
        hl.setSizeFull();
        hl.setSpacing(true);

        Panel part1 = createPart("Empty required fields validation", true,
                false);
        part1.setId("emptyFieldPart");
        hl.addComponent(part1);

        Panel part2 = createPart(
                "Empty required fields with failing validator", true, true);
        part1.setId("validatedFieldPart");
        hl.addComponent(part2);

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel(panelLayout);
        panel.setSizeFull();
        panel.setStyleName(Reindeer.PANEL_LIGHT);
        panelLayout.addComponent(hl);
        addComponent(panel);
    }
View Full Code Here


                }
            }
        });
        part.addComponent(validate);

        Panel panel = new Panel(caption, part);
        panel.setHeight("100%");
        return panel;
    }
View Full Code Here

        final LegacyWindow main = new LegacyWindow("Select demo");
        setMainWindow(main);

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        final Panel panel = new Panel("Select demo", panelLayout);
        panelLayout.addComponent(select);
        VerticalLayout panel2Layout = new VerticalLayout();
        panel2Layout.setMargin(true);
        final Panel panel2 = new Panel("Selection", panel2Layout);
        panel2Layout.addComponent(selectedTask);

        select.setCaption("Select component");
        select.addListener(this);
        select.setImmediate(true);
View Full Code Here

    }

    @Override
    protected void setup() {
        addComponent(log);
        Panel confPanel = new ConfigurationPanel();
        addComponent(confPanel);

        final FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
        fieldGroup.addCommitHandler(new CommitHandler() {
View Full Code Here

        ol.addComponent(t);

        final HorizontalLayout ol2 = new HorizontalLayout();
        final VerticalLayout statusLayout = new VerticalLayout();
        final Panel status = new Panel("Events", statusLayout);
        final Button clear = new Button("clear event log");
        clear.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                statusLayout.removeAllComponents();
                statusLayout.addComponent(ol2);
            }
        });
        ol2.addComponent(clear);
        final Button commit = new Button("commit changes");
        ol2.addComponent(commit);
        statusLayout.addComponent(ol2);

        status.setHeight("300px");
        status.setWidth("400px");

        ol.addComponent(status);

        t.addListener(new Listener() {
            @Override
            public void componentEvent(Event event) {
                statusLayout
                        .addComponent(new Label(event.getClass().getName()));
                // TODO should not use Field.toString()
                statusLayout.addComponent(new Label("selected: "
                        + event.getSource().toString()));
            }
        });

        return new Panel(ol);
    }
View Full Code Here

        l = new Label("A");
        l2 = new Label("B");
        pl = new VerticalLayout();
        pl.setMargin(true);
        p = new Panel("p", pl);
        pl.addComponent(l);
        pl.addComponent(l2);
        main.addComponent(p);
        p2l = new VerticalLayout();
        p2l.setMargin(true);
        p2 = new Panel("p2", p2l);
        p2l.addComponent(l);
        main.addComponent(p2);
        p3l = new VerticalLayout();
        p3l.setMargin(true);
        p3 = new Panel("p3", p3l);
        p2l.addComponent(p3);

        Button b = new Button("use gridlayout", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                p.setContent(new GridLayout());
                p2.setContent(new GridLayout());
                p3.setContent(new GridLayout());
            }

        });
        main.addComponent(b);
        b = new Button("use orderedlayout", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                p.setContent(new VerticalLayout());
                p2.setContent(new VerticalLayout());
                p3.setContent(new VerticalLayout());
            }

        });
        main.addComponent(b);
        b = new Button("move B", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                p2l.addComponent(l2);
            }

        });
        main.addComponent(b);
        b = new Button("move p", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                p3l.addComponent(p);
            }

        });
        main.addComponent(b);
        b = new Button("add to both", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Label l = new Label("both");
                pl.addComponent(l);
                p2l.addComponent(l);
            }

        });
        main.addComponent(b);
        b = new Button("recurse", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    p3l.addComponent(p2);
                    new Notification("ERROR", "This should have failed",
                            Notification.TYPE_ERROR_MESSAGE).show(Page
                            .getCurrent());
                } catch (Exception e) {
                    new Notification("OK", "threw, as expected",
                            Notification.TYPE_ERROR_MESSAGE).show(Page
                            .getCurrent());
                }
            }

        });
        main.addComponent(b);
        b = new Button("recurse2", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                VerticalLayout layout = new VerticalLayout();
                Panel p = new Panel("dynamic", layout);
                layout.addComponent(p2);
                try {
                    p3l.addComponent(p);
                    new Notification("ERROR", "This should have failed",
                            Notification.TYPE_ERROR_MESSAGE).show(Page
View Full Code Here

     *            The text editor
     * @return
     */
    private Component createEditor(String text) {

        Panel editor = new Panel("Text Editor");
        editor.setWidth("580px");

        VerticalLayout panelContent = new VerticalLayout();
        panelContent.setSpacing(true);
        panelContent.setMargin(new MarginInfo(true, false, false, false));
        editor.setContent(panelContent);

        // Create the toolbar
        HorizontalLayout toolbar = new HorizontalLayout();
        toolbar.setSpacing(true);
        toolbar.setMargin(new MarginInfo(false, false, false, true));
View Full Code Here

        }

        // URI
        final VerticalLayout panel1Layout = new VerticalLayout();
        panel1Layout.setMargin(true);
        final Panel panel1 = new Panel("URI Handler", panel1Layout);
        context.setCaption("Last URI handler context");
        panel1Layout.addComponent(context);
        relative.setCaption("Last relative URI");
        panel1Layout.addComponent(relative);
        layout.addComponent(panel1);

        params.addContainerProperty("Key", String.class, "");
        params.addContainerProperty("Value", String.class, "");
        final VerticalLayout panel2Layout = new VerticalLayout();
        panel2Layout.setMargin(true);
        final Panel panel2 = new Panel("Parameter Handler", panel2Layout);
        params.setSizeFull();

        params.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID);
        panel2Layout.addComponent(params);
        layout.addComponent(panel2);
View Full Code Here

        Label l = new Label(
                "This is a nice game to guess how many Layouts your FF2 (or any other browser) can deal with. Due to the worldwide attempt to decrease energy consumption, playing this game is only allowed above 60° longitude betwheen August and May (as excess energy consumed by you CPU is used to heat your room). It is considered wise to save all your work before starting the game.");

        VerticalLayout rootLayout = new VerticalLayout();
        rootLayout.setMargin(true);
        root = new Panel("Test box", rootLayout);
        root.setWidth("600px");
        root.setHeight("200px");
        final Button b = new Button("Go try your luck with " + i + " layouts!");
        b.addListener(new Button.ClickListener() {
View Full Code Here

                });
        buttons.addComponent(b);

        VerticalLayout pl = createPanelLayout();
        Panel p = new Panel("Tree", pl);
        p.setStyleName(Reindeer.PANEL_LIGHT);
        h.addComponent(p);
        Tree tree = new Tree("ITEM_CAPTION_MODE_PROPERTY");
        tree.setContainerDataSource(ordered);
        tree.setItemCaptionPropertyId("Asd");
        tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
        pl.addComponent(tree);
        tree = new Tree("ITEM_CAPTION_MODE_ITEM");
        // nonhierarchical container will get wrapped
        tree.setContainerDataSource(ordered);
        tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_ITEM);
        pl.addComponent(tree);

        pl = createPanelLayout();
        p = new Panel("ComboBox", pl);
        p.setStyleName(Reindeer.PANEL_LIGHT);
        h.addComponent(p);
        ComboBox c = new ComboBox("ITEM_CAPTION_MODE_PROPERTY");
        c.setImmediate(true);
        c.setContainerDataSource(cont);
        c.setItemCaptionPropertyId("Asd");
        c.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY);
        pl.addComponent(c);
        c = new ComboBox("ITEM_CAPTION_MODE_ITEM");
        c.setImmediate(true);
        c.setContainerDataSource(cont);
        c.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ITEM);
        pl.addComponent(c);

        pl = createPanelLayout();
        p = new Panel("ListBox", pl);
        p.setStyleName(Reindeer.PANEL_LIGHT);
        h.addComponent(p);
        ListSelect l = new ListSelect("ITEM_CAPTION_MODE_PROPERTY");
        l.setContainerDataSource(cont);
        l.setItemCaptionPropertyId("Asd");
        l.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY);
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.