Package com.vaadin.ui

Examples of com.vaadin.ui.Panel


            }
            type = "GL";
        }
        String alignText = align ? "-A" : "";
        String cWidth = componentWidth == null ? "" : " - " + componentWidth;
        Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x"
                + h + cWidth, newLayout);

        p.setWidth(w);
        p.setHeight(h);

        newLayout.setSizeFull();

        String captions[] = new String[] { "TextField with caption", null };
        Resource icons[] = new Resource[] {
View Full Code Here


        }

        content.addComponent(table);

        Panel right = new Panel("Panel");

        right.setContent(new Label("Some basic text might show up here."));

        base.addComponent(content);

        base.addComponent(right);
View Full Code Here

        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        w.setContent(new GridLayout(2, 2));
        setMainWindow(w);

        VerticalLayout layout = new VerticalLayout();
        Panel p = new Panel(layout);
        p.setCaption("ExpandLayout");
        p.setWidth("500px");
        p.setHeight("500px");
        layout.setSizeFull();

        w.addComponent(p);

        tf1 = new TextArea();
        tf1.setRows(5);
        tf1.setSizeFull();
        tf1.setValue(contents);
        tf1.setCaption("TextField caption");
        layout.addComponent(tf1);

        /*
         *
         * OrderedLayout
         */

        VerticalLayout layout2 = new VerticalLayout();
        Panel p2 = new Panel(layout2);
        p2.setCaption("OrderedLayout");
        p2.setWidth("500px");
        p2.setHeight("500px");
        layout2.setSizeFull();

        w.addComponent(p2);

        tf2 = new TextArea();
        tf2.setRows(5);
        tf2.setSizeFull();
        tf2.setValue(contents);
        tf2.setCaption("TextField caption");
        layout2.addComponent(tf2);

        /*
         *
         * GridLayout
         */

        VerticalLayout p3l = new VerticalLayout();
        p3l.setMargin(true);
        Panel p3 = new Panel(p3l);
        p3.setCaption("GridLayout");
        p3.setWidth("500px");
        p3.setHeight("500px");
        // p3.setContent(new GridLayout());
        p3l.setSizeFull();
        p3l.setMargin(false);

        GridLayout gl = new GridLayout();
View Full Code Here

    protected Integer getTicketNumber() {
        return 6880;
    }

    private void addDnDPanel(Component content) {
        Panel panel = new Panel();
        panel.setSizeUndefined();
        panel.setWidth("300px");
        panel.setHeight("150px");
        DragAndDropWrapper dndWrapper = new DragAndDropWrapper(content);
        dndWrapper.setSizeFull();
        panel.setContent(dndWrapper);
        addComponent(panel);
    }
View Full Code Here

    }

    private void gridLayout(Layout layout) {
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel("GridLayout", pl);
        p.setWidth("500px");
        p.setHeight("500px");
        pl.setSizeFull();
        layout.addComponent(p);

        GridLayout gl = new GridLayout(1, 4);
        gl.setMargin(true);
        gl.setCaption("Horizontal");
        gl.setWidth("100%");

        // Button b;

        // b = new Button("Wide button");
        // b.setWidth("500");
        // gl.addComponent(b);

        addButtons(gl);

        p.setContent(gl);

        /* VERTICAL */

        gl = new GridLayout(4, 1);
        gl.setMargin(true);
        // gl.setCaption("Vertical");
        gl.setHeight("100%");
        addButtons(gl);

        // Button b = new Button("High button");
        // b.setHeight(200);
        // gl.addComponent(b);

        p.setContent(gl);

    }
View Full Code Here

    }

    private void orderedLayout(Layout layout) {
        VerticalLayout pl = new VerticalLayout();
        pl.setMargin(true);
        Panel p = new Panel("OrderedLayout", pl);
        p.setWidth("500px");
        p.setHeight("500px");
        pl.setWidth("100%");
        layout.addComponent(p);

        AbstractOrderedLayout ol = new VerticalLayout();
        ol.setMargin(true);
View Full Code Here

    }

    private void expandLayout(Layout layout) {
        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel p = new Panel("ExpandLayout", panelLayout);
        layout.addComponent(p);
        panelLayout.setWidth("500");
        panelLayout.setHeight("400");

        AbstractOrderedLayout el = new VerticalLayout();
View Full Code Here

                + "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

    }

    @Override
    protected void setup(VaadinRequest request) {
        {
            final Panel p = new Panel("Drag here");
            addComponent(p);

            final CssLayout layout = new CssLayout();
            layout.setId("csslayout-1");
            layout.setHeight("100px");

            final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
            dnd.setId("ddwrapper-1");
            p.setContent(dnd);

            final CheckBox enabled = new CheckBox("Enabled", true);
            addComponent(enabled);
            enabled.setImmediate(true);
            enabled.addListener(new ValueChangeListener() {

                @Override
                public void valueChange(ValueChangeEvent event) {
                    dnd.setEnabled(enabled.booleanValue());
                }
            });

            dnd.setDropHandler(new DropHandler() {

                @Override
                public AcceptCriterion getAcceptCriterion() {
                    return AcceptAll.get();
                }

                @Override
                public void drop(DragAndDropEvent event) {
                    layout.addComponent(new Label("You dropped something!"));
                }
            });

            dnd.setDragStartMode(DragStartMode.COMPONENT);
        }

        {
            final Panel p = new Panel("Drag here");
            addComponent(p);

            final CssLayout layout = new CssLayout();
            layout.setId("csslayout-2");
            layout.setHeight("100px");

            final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
            dnd.setId("ddwrapper-2");
            p.setContent(dnd);

            final CheckBox enabled = new CheckBox("Enabled", true);
            addComponent(enabled);
            enabled.setImmediate(true);
            enabled.addListener(new ValueChangeListener() {
View Full Code Here

        Window w = new Window();
        w.setWidth("300px");
        w.setHeight("300px");
        w.center();

        Panel p = createPanel();
        p.setSizeFull();

        w.setContent(p);

        addWindow(w);
    }
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.