Example usage for com.vaadin.ui Panel setSizeFull

List of usage examples for com.vaadin.ui Panel setSizeFull

Introduction

In this page you can find the example usage for com.vaadin.ui Panel setSizeFull.

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:by.bigvova.views.HomeView.java

License:Apache License

public HomeView() {
    setSpacing(true);//from   www.ja va2s . c  o m
    setMargin(true);
    setSizeFull();

    Label header = new Label("   -=FoodNote=-");
    header.addStyleName(ValoTheme.LABEL_H1);
    addComponent(header);
    Label body = new Label(
            "<h3> ?? ? ? <b>CRUD</b> ?  ? <b>enterprise</b> ."
                    + "   ?  ?? ,    ?  ? .</h3>"
                    + "? ?:" + "<ul>"
                    + "<li>?  ?  <b>Spring Boot</b>, ? ? - propertie .</li>"
                    + "<li>? ?  ?? ? ???   <b>Repository</b> - <b>Spring Data JPA</b>, <b>Hibernate</b> (<b>JdbcTemplate</b>  ?).</li>"
                    + "<li> ?? - ?? ,  :</li>"
                    + "<ul>" + "<li>  - <b>PostgreSQL</b></li>"
                    + "<li>connection pool - <b>HikariCP</b></li>" + "</ul>"
                    + "<li>? - <b>EhCache</b>.</li>"
                    + "<li> ? -  <b>EventBus</b>, ? <b>Google Guava</b>.</li>"
                    + "<li>?,  - <b>Spring Security</b>:</li>"
                    + "<ul>"
                    + "<li>    , ? <b>UserDetails</b></li>"
                    + "<li> ??   ? <b>BCrypt</b></li>"
                    + "<li>  <b>Remember Me</b> ??</li>"
                    + "</ul>" + "<li>? - <b>JUnit4</b></li>"
                    + "<li> - <b>slf4j</b>, <b>logback</b></li>"
                    + "<li>Front-end - <b>Vaadin framework</b>, <b>GWT</b></li>"
                    + "<li>   <b>Docker</b>      ? <b>Ubuntu Server 14.04</b></li>"
                    + "</ul>"
                    + "<p>? Spring Boot - Vaadin ?? : <a href=\"https://github.com/peholmst/vaadin4spring\">vaadin4spring</a></p>"
                    + "<p> ? <a href=\"https://github.com/BigVOVA/FoodNote\">github.com/BigVOVA/FoodNote</a></p>");
    body.setContentMode(ContentMode.HTML);
    VerticalLayout bodyLayout = new VerticalLayout();
    bodyLayout.setWidth(100, Unit.PERCENTAGE);
    bodyLayout.setMargin(new MarginInfo(false, true, false, true));
    bodyLayout.addComponent(body);
    Panel panel = new Panel();
    panel.setSizeFull();
    panel.setContent(bodyLayout);
    addComponent(panel);
    setExpandRatio(panel, 1);
}

From source file:com.arcusys.liferay.vaadinplugin.ui.OutputConsole.java

License:Apache License

public OutputConsole(String caption) {
    Panel panel = new Panel();
    panel.setCaption(caption);//www . j a v  a  2s.com
    panel.setSizeFull();
    setCompositionRoot(panel);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeUndefined();
    panel.setContent(layout);

    VerticalLayout outputLabelLayout = new VerticalLayout();
    outputLabelLayout.setSizeUndefined();
    outputLabelLayout.setMargin(true);
    layout.addComponent(outputLabelLayout);

    outputLabel.setSizeUndefined();
    outputLabelLayout.addComponent(outputLabel);

    scrollToLabel.setWidth("0px");
    scrollToLabel.setHeight("0px");
    layout.addComponent(scrollToLabel);
}

From source file:com.bellkenz.modules.PersonalInformation.java

public ComponentContainer personalInformation() {
    employeeInformationDAO = new EmployeeInformationDAO(getEmployeeId());
    employeePersonalInformation = new EmployeePersonalInformation();

    GridLayout glayout = new GridLayout(5, 9);
    glayout.setSpacing(true);/*from   ww w . j  a v a2  s.co m*/
    glayout.setMargin(true);

    final Panel imagePanel = new Panel();
    imagePanel.setStyleName("light");
    AbstractLayout panelLayout = (AbstractLayout) imagePanel.getContent();
    panelLayout.setMargin(false);
    imagePanel.setSizeFull();

    employeeImage = new Embedded(null, new ThemeResource("../myTheme/images/ronnie.jpg"));
    employeeImage.setImmediate(true);
    employeeImage.setWidth(90, Sizeable.UNITS_PIXELS);
    employeeImage.setHeight(90, Sizeable.UNITS_PIXELS);
    employeeImage.setStyleName("logo-img");
    imagePanel.addComponent(employeeImage);
    glayout.addComponent(employeeImage, 0, 0, 0, 1);
    glayout.setComponentAlignment(imagePanel, Alignment.MIDDLE_CENTER);

    firstname = createTextField("Firstname: ");
    glayout.addComponent(firstname, 1, 0, 2, 0);

    final TextField middlename = createTextField("Middlename: ");
    glayout.addComponent(middlename, 3, 0);

    final TextField lastname = createTextField("Lastname: ");
    glayout.addComponent(lastname, 4, 0);

    final TextField houseNo = createTextField("No: ");
    houseNo.setWidth("40px");
    glayout.addComponent(houseNo, 1, 1);

    final TextField street = createTextField("Street: ");
    street.setWidth("118");
    glayout.addComponent(street, 2, 1);

    final TextField city = createTextField("City: ");
    glayout.addComponent(city, 3, 1);

    final TextField zipCode = createTextField("Zip Code:");
    glayout.addComponent(zipCode, 4, 1);

    final TextField nickname = createTextField("Nickname: ");
    nickname.setWidth("90px");
    glayout.addComponent(nickname, 0, 2);

    final TextField permanentAddress = createTextField("Permanent/Provincial Address: ");
    permanentAddress.setWidth("533px");
    glayout.addComponent(permanentAddress, 1, 2, 4, 2);

    Button uploadPicture = new Button("Upload...");
    uploadPicture.setWidth("100%");
    uploadPicture.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (employeeId == null) {
                getWindow().showNotification("You did not select and Employee!",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            Window uploadImage = new UploadImage(imagePanel, employeeImage, employeeId);
            uploadImage.setWidth("450px");
            if (uploadImage.getParent() == null) {
                getWindow().addWindow(uploadImage);
            }
            uploadImage.setModal(true);
            uploadImage.center();
        }
    });
    glayout.addComponent(uploadPicture, 0, 3);

    final TextField landline = createTextField("Landline #: ");
    glayout.addComponent(landline, 1, 3, 2, 3);

    final TextField mobileNo = createTextField("Mobile #: ");
    glayout.addComponent(mobileNo, 3, 3);

    final TextField age = createTextField("Age: ");
    glayout.addComponent(age, 4, 3);

    final TextField emailAddress = createTextField("Email Address: ");
    glayout.addComponent(emailAddress, 1, 4, 2, 4);

    final PopupDateField dob = (PopupDateField) createDateField("Date of Birth: ");
    glayout.addComponent(dob, 3, 4);

    final TextField height = createTextField("Height: ");
    glayout.addComponent(height, 4, 4);

    final ComboBox civilStatus = new ComboBox("Civil Status: ");
    civilStatus.setWidth("100%");
    dropDownBoxList.populateCivilStatusList(civilStatus);
    glayout.addComponent(civilStatus, 1, 5, 2, 5);

    final ComboBox gender = new ComboBox("Gender: ");
    gender.setWidth("100%");
    dropDownBoxList.populateGenderList(gender);
    glayout.addComponent(gender, 3, 5);

    final TextField weight = createTextField("Weigth: ");
    glayout.addComponent(weight, 4, 5);

    final TextField driversLicenseNo = createTextField("Drivers License: ");
    glayout.addComponent(driversLicenseNo, 1, 6, 2, 6);

    final TextField restrictionCode = createTextField("Restriction Code: ");
    glayout.addComponent(restrictionCode, 3, 6);

    final TextField religion = createTextField("Religion: ");
    glayout.addComponent(religion, 4, 6);

    final ComboBox division = new ComboBox("Division: ");
    division.setWidth("100%");
    dropDownBoxList.populateBranchComboBox(division);
    glayout.addComponent(division, 1, 7, 2, 7);

    final ComboBox department = dropDownBoxList.populateDepartment(new ComboBox());
    department.setWidth("100%");
    division.addListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            if (division.getValue() == null) {
            } else {
                divisionId = branchDAO.getBranchId(division.getValue().toString());
            }
        }

    });
    glayout.addComponent(department, 3, 7);

    final TextField position = createTextField("Position: ");
    glayout.addComponent(position, 4, 7);
    //glayout.setComponentAlignment(position, Alignment.BOTTOM_LEFT);

    Button transferButton = new Button("Transfer Employee");
    transferButton.setWidth("100%");
    transferButton.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (getEmployeeId() == null) {
                getWindow().showNotification("You did not select an Employee!",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            Window subWindow = transferEmployee(getEmployeeId(), division, department, position);
            if (subWindow.getParent() == null) {
                getWindow().addWindow(subWindow);
            }
            subWindow.setModal(true);
            subWindow.center();
        }
    });
    glayout.addComponent(transferButton, 1, 8, 2, 8);
    glayout.setComponentAlignment(transferButton, Alignment.BOTTOM_CENTER);

    if (employeeId != null) {
        epiList = employeeInformationDAO.employeePersonalInformation();
        for (EmployeePersonalInformation epi : epiList) {
            final byte[] image = epi.getImage();
            if (image != null) {
                StreamResource.StreamSource imageSource = new StreamResource.StreamSource() {

                    @Override
                    public InputStream getStream() {
                        return new ByteArrayInputStream(image);
                    }

                };

                StreamResource imageResource = new StreamResource(imageSource, epi.getFirstname() + ".jpg",
                        getApplication());
                imageResource.setCacheTime(0);
                employeeImage.setSource(imageResource);
            }
            firstname.setValue(epi.getFirstname());
            middlename.setValue(epi.getMiddlename());
            lastname.setValue(epi.getLastname());
            houseNo.setValue(epi.getHouseNumber());

            street.setValue(epi.getStreet());
            city.setValue(epi.getStreet());
            zipCode.setValue(epi.getZipCode());
            nickname.setValue(epi.getNickname());
            permanentAddress.setValue(epi.getPermanentAddress());
            landline.setValue(epi.getLandlineNumber());
            mobileNo.setValue(epi.getMobileNumber());
            age.setValue(epi.getAge());
            emailAddress.setValue(epi.getEmailAddress());

            if (epi.getDob() != null) {
                dob.setValue(conUtil.parsingDate(epi.getDob()));
            } else {
                dob.setValue(null);
            }

            height.setValue(epi.getHeight());

            if (epi.getCivilStatus() != null) {
                Object civilStatusId = civilStatus.addItem();
                civilStatus.setItemCaption(civilStatusId, epi.getCivilStatus());
                civilStatus.setValue(civilStatusId);
            }

            if (epi.getGender() != null) {
                Object genderId = gender.addItem();
                gender.setItemCaption(genderId, epi.getGender());
                gender.setValue(genderId);
            }

            weight.setValue(epi.getWeight());
            driversLicenseNo.setValue(epi.getDriversLicense());
            restrictionCode.setValue(epi.getRestrictionCode());
            religion.setValue(epi.getReligion());
            position.setValue(epi.getPosition());

            Object divisionObjectId = division.addItem();
            division.setItemCaption(divisionObjectId, epi.getDivision());
            division.setValue(divisionObjectId);

            Object departmentObjectId = department.addItem();
            department.setItemCaption(departmentObjectId, epi.getDepartment());
            department.setValue(departmentObjectId);
        }
    }

    firstname.addListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            employeePersonalInformation.setFirstname(event.getProperty().getValue().toString());
        }
    });
    firstname.setImmediate(true);
    setInformation(employeePersonalInformation);

    return glayout;
}

From source file:com.cavisson.gui.dashboard.components.controls.CommonParts.java

License:Apache License

Panel windows() {
    Panel p = new Panel("Dialogs");
    VerticalLayout content = new VerticalLayout() {
        final Window win = new Window("Window Caption");
        String prevHeight = "300px";
        boolean footerVisible = true;
        boolean autoHeight = false;
        boolean tabsVisible = false;
        boolean toolbarVisible = false;
        boolean footerToolbar = false;
        boolean toolbarLayout = false;
        String toolbarStyle = null;

        VerticalLayout windowContent() {
            VerticalLayout root = new VerticalLayout();

            if (toolbarVisible) {
                MenuBar menuBar = MenuBars.getToolBar();
                menuBar.setSizeUndefined();
                menuBar.setStyleName(toolbarStyle);
                Component toolbar = menuBar;
                if (toolbarLayout) {
                    menuBar.setWidth(null);
                    HorizontalLayout toolbarLayout = new HorizontalLayout();
                    toolbarLayout.setWidth("100%");
                    toolbarLayout.setSpacing(true);
                    Label label = new Label("Tools");
                    label.setSizeUndefined();
                    toolbarLayout.addComponents(label, menuBar);
                    toolbarLayout.setExpandRatio(menuBar, 1);
                    toolbarLayout.setComponentAlignment(menuBar, Alignment.TOP_RIGHT);
                    toolbar = toolbarLayout;
                }/*from w  ww.j av  a  2 s.c o m*/
                toolbar.addStyleName("v-window-top-toolbar");
                root.addComponent(toolbar);
            }

            Component content = null;

            if (tabsVisible) {
                TabSheet tabs = new TabSheet();
                tabs.setSizeFull();
                VerticalLayout l = new VerticalLayout();
                l.addComponent(new Label(
                        "<h2>Subtitle</h2><p>Normal type for plain text. Etiam at risus et justo dignissim congue. Phasellus laoreet lorem vel dolor tempus vehicula.</p><p>Quisque ut dolor gravida, placerat libero vel, euismod. Etiam habebis sem dicantur magna mollis euismod. Nihil hic munitissimus habendi senatus locus, nihil horum? Curabitur est gravida et libero vitae dictum. Ullamco laboris nisi ut aliquid ex ea commodi consequat. Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</p>",
                        ContentMode.HTML));
                l.setMargin(true);
                tabs.addTab(l, "Selected");
                tabs.addTab(new Label("&nbsp;", ContentMode.HTML), "Another");
                tabs.addTab(new Label("&nbsp;", ContentMode.HTML), "One more");
                tabs.addStyleName("padded-tabbar");
                tabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
                    @Override
                    public void selectedTabChange(final SelectedTabChangeEvent event) {
                        try {
                            Thread.sleep(600);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                });
                content = tabs;
            } else if (!autoHeight) {
                Panel p = new Panel();
                p.setSizeFull();
                p.addStyleName("borderless");
                if (!toolbarVisible || !toolbarLayout) {
                    p.addStyleName("scroll-divider");
                }
                VerticalLayout l = new VerticalLayout();
                l.addComponent(new Label(
                        "<h2>Subtitle</h2><p>Normal type for plain text. Etiam at risus et justo dignissim congue. Phasellus laoreet lorem vel dolor tempus vehicula.</p><p>Quisque ut dolor gravida, placerat libero vel, euismod. Etiam habebis sem dicantur magna mollis euismod. Nihil hic munitissimus habendi senatus locus, nihil horum? Curabitur est gravida et libero vitae dictum. Ullamco laboris nisi ut aliquid ex ea commodi consequat. Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</p>",
                        ContentMode.HTML));
                l.setMargin(true);
                p.setContent(l);
                content = p;
            } else {
                content = new Label(
                        "<h2>Subtitle</h2><p>Normal type for plain text. Etiam at risus et justo dignissim congue. Phasellus laoreet lorem vel dolor tempus vehicula.</p><p>Quisque ut dolor gravida, placerat libero vel, euismod. Etiam habebis sem dicantur magna mollis euismod. Nihil hic munitissimus habendi senatus locus, nihil horum? Curabitur est gravida et libero vitae dictum. Ullamco laboris nisi ut aliquid ex ea commodi consequat. Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</p>",
                        ContentMode.HTML);
                root.setMargin(true);
            }

            root.addComponent(content);

            if (footerVisible) {
                HorizontalLayout footer = new HorizontalLayout();
                footer.setWidth("100%");
                footer.setSpacing(true);
                footer.addStyleName("v-window-bottom-toolbar");

                Label footerText = new Label("Footer text");
                footerText.setSizeUndefined();

                Button ok = new Button("OK");
                ok.addStyleName("primary");

                Button cancel = new Button("Cancel");

                footer.addComponents(footerText, ok, cancel);
                footer.setExpandRatio(footerText, 1);

                if (footerToolbar) {
                    MenuBar menuBar = MenuBars.getToolBar();
                    menuBar.setStyleName(toolbarStyle);
                    menuBar.setWidth(null);
                    footer.removeAllComponents();
                    footer.addComponent(menuBar);
                }

                root.addComponent(footer);
            }

            if (!autoHeight) {
                root.setSizeFull();
                root.setExpandRatio(content, 1);
            }

            return root;
        }

        {
            setSpacing(true);
            setMargin(true);
            win.setWidth("380px");
            win.setHeight(prevHeight);
            win.setClosable(false);
            win.setResizable(false);
            win.setContent(windowContent());
            win.setCloseShortcut(KeyCode.ESCAPE, null);

            Command optionsCommand = new Command() {
                @Override
                public void menuSelected(final MenuItem selectedItem) {
                    if (selectedItem.getText().equals("Footer")) {
                        footerVisible = selectedItem.isChecked();
                    }
                    if (selectedItem.getText().equals("Auto Height")) {
                        autoHeight = selectedItem.isChecked();
                        if (!autoHeight) {
                            win.setHeight(prevHeight);
                        } else {
                            prevHeight = win.getHeight() + win.getHeightUnits().toString();
                            win.setHeight(null);
                        }
                    }
                    if (selectedItem.getText().equals("Tabs")) {
                        tabsVisible = selectedItem.isChecked();
                    }

                    if (selectedItem.getText().equals("Top")) {
                        toolbarVisible = selectedItem.isChecked();
                    }

                    if (selectedItem.getText().equals("Footer")) {
                        footerToolbar = selectedItem.isChecked();
                    }

                    if (selectedItem.getText().equals("Top layout")) {
                        toolbarLayout = selectedItem.isChecked();
                    }

                    if (selectedItem.getText().equals("Borderless")) {
                        toolbarStyle = selectedItem.isChecked() ? "borderless" : null;
                    }

                    win.setContent(windowContent());
                }
            };

            MenuBar options = new MenuBar();
            options.setCaption("Content");
            options.addItem("Auto Height", optionsCommand).setCheckable(true);
            options.addItem("Tabs", optionsCommand).setCheckable(true);
            MenuItem option = options.addItem("Footer", optionsCommand);
            option.setCheckable(true);
            option.setChecked(true);
            options.addStyleName("small");
            addComponent(options);

            options = new MenuBar();
            options.setCaption("Toolbars");
            options.addItem("Footer", optionsCommand).setCheckable(true);
            options.addItem("Top", optionsCommand).setCheckable(true);
            options.addItem("Top layout", optionsCommand).setCheckable(true);
            options.addItem("Borderless", optionsCommand).setCheckable(true);
            options.addStyleName("small");
            addComponent(options);

            Command optionsCommand2 = new Command() {
                @Override
                public void menuSelected(final MenuItem selectedItem) {
                    if (selectedItem.getText().equals("Caption")) {
                        win.setCaption(selectedItem.isChecked() ? "Window Caption" : null);
                    } else if (selectedItem.getText().equals("Closable")) {
                        win.setClosable(selectedItem.isChecked());
                    } else if (selectedItem.getText().equals("Resizable")) {
                        win.setResizable(selectedItem.isChecked());
                    } else if (selectedItem.getText().equals("Modal")) {
                        win.setModal(selectedItem.isChecked());
                    }
                }
            };

            options = new MenuBar();
            options.setCaption("Options");
            MenuItem caption = options.addItem("Caption", optionsCommand2);
            caption.setCheckable(true);
            caption.setChecked(true);
            options.addItem("Closable", optionsCommand2).setCheckable(true);
            options.addItem("Resizable", optionsCommand2).setCheckable(true);
            options.addItem("Modal", optionsCommand2).setCheckable(true);
            options.addStyleName("small");
            addComponent(options);

            final Button show = new Button("Open Window", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    getUI().addWindow(win);
                    win.center();
                    win.focus();
                    event.getButton().setEnabled(false);
                }
            });
            show.addStyleName("primary");
            addComponent(show);

            final CheckBox hidden = new CheckBox("Hidden");
            hidden.addValueChangeListener(new ValueChangeListener() {
                @Override
                public void valueChange(final ValueChangeEvent event) {
                    win.setVisible(!hidden.getValue());
                }
            });
            addComponent(hidden);

            win.addCloseListener(new CloseListener() {
                @Override
                public void windowClose(final CloseEvent e) {
                    show.setEnabled(true);
                }
            });
        }
    };
    p.setContent(content);
    return p;

}

From source file:com.cerebro.provevaadin.ChatOffGame.java

public ChatOffGame() {
    Panel messagesPanel = new Panel();
    messagesPanel.setSizeFull();
    messagesPanel.setContent(messages);/*from w ww .  j a  va2s.c o  m*/
    this.addComponent(messagesPanel);
    this.setExpandRatio(messagesPanel, 1.0f);

    HorizontalLayout sendBar = new HorizontalLayout();
    sendBar.setWidth("100%");
    final TextField input = new TextField();
    input.setWidth("100%");
    sendBar.addComponent(input);
    sendBar.setExpandRatio(input, 1.0f);

    Button send = new Button("Send");
    send.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);
    send.addClickListener((Button.ClickEvent event) -> {
        BroadcasterOffGame.broadcast(input.getValue(), FROM);
        input.setValue("");
    });
    sendBar.addComponent(send);
    this.addComponent(sendBar);

    BroadcasterOffGame.register(this);
}

From source file:com.cerebro.provevaadin.ChatOnGame.java

public ChatOnGame(User user) {
    if (user.getUltimoLuogoPG() != null) {
        logger.info("Luogo: " + user.getUltimoLuogoPG());
    } else {//from   w w  w.  j a v  a2 s.c o m
        logger.info("Nessun luogo selezionato");
    }
    Panel messagesPanel = new Panel();
    messagesPanel.setSizeFull();
    messagesPanel.setContent(messages);
    this.addComponent(messagesPanel);
    this.setExpandRatio(messagesPanel, 1.0f);

    HorizontalLayout sendBar = new HorizontalLayout();
    sendBar.setWidth("100%");
    final TextField input = new TextField();
    input.setWidth("100%");
    sendBar.addComponent(input);
    sendBar.setExpandRatio(input, 1.0f);

    Button send = new Button("Send");
    send.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);
    send.addClickListener((Button.ClickEvent event) -> {
        logger.info("Invio del messaggio al server");
        BroadcasterOnGame.broadcast(input.getValue(), FROM);
        input.setValue("");
    });
    sendBar.addComponent(send);
    this.addComponent(sendBar);

    BroadcasterOnGame.register(this);
}

From source file:com.cxplonka.feature.ui.vaadin.VaadinUI.java

private void initLayout() {
    final VerticalLayout root = new VerticalLayout();
    root.setSizeFull();//from   ww  w  .j  a  v  a  2  s  . c om
    root.setMargin(true);
    root.setSpacing(true);
    setContent(root);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);

    navigationBar.addComponent(createNavigationButton("Default View", DefaultView.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("Data View", DataTableView.VIEW_NAME));

    root.addComponent(navigationBar);

    final Panel viewContainer = new Panel();
    viewContainer.setSizeFull();
    root.addComponent(viewContainer);
    root.setExpandRatio(viewContainer, 1.0f);

    Navigator navigator = new Navigator(this, viewContainer);
    navigator.addProvider(viewProvider);
}

From source file:com.etest.connection.ErrorDBNotification.java

public static void showLoggedErrorOnWindow(String str) {
    Window sub = new Window("Logged ERROR");
    sub.setWidth("500px");
    sub.setHeight("300px");
    if (sub.getParent() == null) {
        UI.getCurrent().addWindow(sub);/*from  w  w  w . j av  a  2  s .c  om*/
    }
    sub.setModal(true);

    Panel panel = new Panel();
    panel.setSizeFull();

    panel.setContent(new Label(str));
    sub.setContent(panel);
}

From source file:com.foc.vaadin.FocWebApplication.java

License:Apache License

protected void init2(VaadinRequest request) {
    // Create the footer Layout with a simple Label
    VerticalLayout footerLayout = new VerticalLayout();
    {/*  w  ww . j av  a 2s.  co  m*/
        footerLayout.addComponent(new Label("This is the footer always visible"));
        footerLayout.setHeight("-1px");
    }

    // Create the Body Panel that contains a VerticalLayout itself
    Panel panel = new Panel();
    {
        panel.setSizeFull();// Panel size is undefined
        final VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setSizeUndefined();// Panel Layout size is undefined
        panel.setContent(panelLayout);

        // Fill the panel layout with lots of labels to exceed the window height 
        for (int i = 0; i < 200; i++) {
            panelLayout.addComponent(new Label("Thank you for clicking"));
        }
    }

    // Put all in the the MainVerticalLayout
    final VerticalLayout mainVerticalLayout = new VerticalLayout();
    mainVerticalLayout.setSizeFull();// Main Layout is set to size Full so that it fills all the height
    mainVerticalLayout.addComponent(panel);
    mainVerticalLayout.addComponent(footerLayout);
    mainVerticalLayout.setExpandRatio(panel, 1);
    setContent(mainVerticalLayout);
}

From source file:com.github.mjvesa.herd.HerdIDE.java

License:Apache License

private Panel createMainPanel() {
    Panel p = new Panel();
    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);/*ww w .  ja va2s  .co m*/
    p.setContent(vl);
    p.setSizeFull();
    return p;
}