Package com.vaadin.ui

Examples of com.vaadin.ui.Window


            addCommentButton.addClickListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {

                    final Window w = new Window("Add comment");
                    VerticalLayout vl = new VerticalLayout();
                    vl.setMargin(true);

                    final TextField tf = new TextField();
                    tf.setSizeFull();
                    vl.addComponent(tf);

                    HorizontalLayout hl = new HorizontalLayout();

                    Button okButton = new Button("OK");
                    okButton.setWidth("100%");
                    okButton.addClickListener(new ClickListener() {
                        @Override
                        public void buttonClick(ClickEvent event) {
                            addRow("[ " + tf.getValue() + " ]");
                            tf.setValue("");
                            w.close();
                            removeWindow(w);
                        }
                    });

                    Button cancelButton = new Button("Cancel");
                    cancelButton.setWidth("100%");
                    cancelButton.addClickListener(new ClickListener() {
                        @Override
                        public void buttonClick(ClickEvent event) {
                            tf.setValue("");
                            w.close();
                            removeWindow(w);
                        }
                    });

                    hl.addComponent(cancelButton);
                    hl.addComponent(okButton);
                    hl.setSpacing(true);
                    hl.setWidth("100%");

                    vl.addComponent(hl);
                    vl.setSpacing(true);

                    w.setContent(vl);
                    addWindow(w);
                }
            });

            addComponent(addCommentButton);
View Full Code Here


        addComponent(images);
        addComponent(gl);

        getLayout().setSpacing(true);

        Window w = new Window();
        w.setContent(new VerticalLayout(new Button("Button in window")));
        addWindow(w);
    }
View Full Code Here

        // ATM supports only images.
        if (file.getType().equals("image/png")) {
            Embedded embedded = new Embedded(file.getName(), file.getResource());
            VerticalLayout layout = new VerticalLayout();
            layout.setMargin(true);
            Window w = new Window(file.getName(), layout);
            layout.addComponent(embedded);
            layout.setSizeUndefined();
            getMainWindow().addWindow(w);
        } else if (file.getType().equals("text/csv")) {
            showSpreadsheet(file);
View Full Code Here

            String[] split = rows[i].split(",");
            table.addItem(split, "" + i);
        }
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window(file.getName(), layout);
        layout.setSizeUndefined();
        table.setEditable(true);
        layout.addComponent(table);
        getMainWindow().addWindow(w);
View Full Code Here

        tf.setValue("The textfield should fill the window."
                + "\n - Try to resize window\n - Try to push REdo button");
        tf.setRows(10);
        tf.setWidth("100%");
        lo.addComponent(tf);
        Window subWin = new Window(
                "This window should initially be as wide as the caption", lo);
        main.addWindow(subWin);
        // subWin.setWidth("500px");
    }
View Full Code Here

        hl.addComponent(vlTF2);

        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.setSizeUndefined();
        Window wnd = new Window("Test", layout);
        layout.addComponent(hl);
        Button btn = new Button("Show/hide");
        btn.addClickListener(new Button.ClickListener() {

            @Override
View Full Code Here

        Button b = new Button("Button");
        b.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                Window w = new Window("This is a window");
                w.setModal(true);
                getMainWindow().addWindow(w);
            }
        });
        addComponent(b);
    }
View Full Code Here

    private void createCalendarEventPopup() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        layout.setSpacing(true);

        scheduleEventPopup = new Window(null, layout);
        scheduleEventPopup.setWidth("400px");
        scheduleEventPopup.setModal(true);
        scheduleEventPopup.center();

        layout.addComponent(scheduleEventFieldLayout);
View Full Code Here

     * @return
     */
    private void createWindowWith(String caption, String primaryStyleName,
            String styleName) {

        Window window = new Window();
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        window.setContent(layout);
        layout.addComponent(new Label("Some content"));

        if (caption != null) {
            window.setCaption(caption);
        }

        if (primaryStyleName != null) {
            window.addStyleName(primaryStyleName);
        }

        if (styleName != null) {
            window.addStyleName(styleName);
        }

        parent.getUI().addWindow(window);

    }
View Full Code Here

                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        VerticalLayout layout = new VerticalLayout();
                        layout.setMargin(true);
                        final Window w = new Window("sw "
                                + System.currentTimeMillis(), layout);
                        main.addWindow(w);
                        w.setPositionX(100);
                        w.setPositionY(100);
                        w.setWidth("200px");
                        w.setHeight("200px");

                        w.setWidth("100px");
                        w.setHeight("400px");

                        final Button closebutton = new Button("Close "
                                + w.getCaption(), new Button.ClickListener() {
                            @Override
                            public void buttonClick(ClickEvent event) {
                                main.removeWindow(w);
                            }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Window

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.