Example usage for com.vaadin.ui VerticalLayout VerticalLayout

List of usage examples for com.vaadin.ui VerticalLayout VerticalLayout

Introduction

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

Prototype

public VerticalLayout() 

Source Link

Document

Constructs an empty VerticalLayout.

Usage

From source file:com.antonjohansson.lprs.view.ServiceView.java

License:Apache License

private Layout setPasswordLayout() {
    newPassword.setWidth(STANDARD_WIDTH, EM);
    newPassword.setCaption("Password");
    newPasswordRepeat.setWidth(STANDARD_WIDTH, EM);
    newPasswordRepeat.setCaption("Repeat password");
    setPassword.setCaption("Set password");
    backFromSetPassword.setCaption("Back");

    HorizontalLayout buttons = new HorizontalLayout(setPassword, backFromSetPassword);
    buttons.setSpacing(true);/*  w  w  w.  ja va 2s  .c  om*/

    VerticalLayout layout = new VerticalLayout();
    layout.addComponents(newPassword, newPasswordRepeat, buttons);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setVisible(false);
    layout.setWidthUndefined();

    return layout;
}

From source file:com.antonjohansson.managementcenter.core.web.welcome.WelcomeView.java

License:Apache License

private Component buildConnectForm() {
    final VerticalLayout panel = new VerticalLayout();
    panel.setSizeUndefined();/*w  ww . ja v  a 2 s  . c o m*/
    panel.setSpacing(true);

    panel.addComponent(getHeader());
    panel.addComponent(getExistingConnectionLayout());
    panel.addComponent(getNewConnectionLayout());
    return panel;
}

From source file:com.arcusys.liferay.vaadinplugin.ControlPanelUI.java

License:Apache License

private void createUI() {
    //create main layout
    mainLayout = new VerticalLayout();
    mainLayout.setWidth("720px");
    mainLayout.setSpacing(true);//from  w w w. ja va2  s  .  c o  m

    setContent(mainLayout);

    //create Setting layout
    settingsPanel = new Panel("Settings");
    settingsLayout = new FormLayout();
    settingsPanel.setContent(settingsLayout);

    versionUpgradeProgressIndicator = createProgressIndicator();

    changeVersionButton = createChangeVersionButton();
    updateVaadinVersionButton = createUpdateVaadinVersionButton();

    Version vaadinNewestVersion = newestDownloadInfo.getVersion();
    //add details
    detailsButton = createDetailsButton();

    vaadinVersionLayout = createVaadinVersionLayout(vaadinNewestVersion.toString(), changeVersionButton,
            updateVaadinVersionButton, versionUpgradeProgressIndicator, detailsButton);
    settingsLayout.addComponent(vaadinVersionLayout);

    activeWidgetsetLabel = createActiveWidgetsetLabel();
    settingsLayout.addComponent(activeWidgetsetLabel);

    // Add-on selection
    HorizontalLayout addonDirectoryLayout = createAddonDirectoryLayout();
    settingsLayout.addComponent(addonDirectoryLayout);

    //Add-on included
    includeAddonsOptionGroup = createIncludeAddonsList();
    addonsListHolder = createIncludeAddonsListLayout(includeAddonsOptionGroup);
    settingsLayout.addComponent(addonsListHolder);

    //addition dependencies
    additionalDependenciesLabel = createAdditionalDependenciesLabel();
    settingsLayout.addComponent(additionalDependenciesLabel);

    mainLayout.addComponent(settingsPanel);

    additionalDependenciesButton = createAdditionalDependenciesButton();
    mainLayout.addComponent(additionalDependenciesButton);

    //Compilation layout
    HorizontalLayout compilationlayout = new HorizontalLayout();
    compileWidgetsetButton = createCompileWidgetsetButton();
    compilationlayout.addComponent(compileWidgetsetButton);
    terminateCompilationButton = createTerminateCompilationButton();
    compilationlayout.addComponent(terminateCompilationButton);
    compilationProgressIndicator = createProgressIndicator();
    compilationlayout.addComponent(compilationProgressIndicator);
    compilationlayout.setComponentAlignment(compilationProgressIndicator, Alignment.MIDDLE_LEFT);
    settingsLayout.addComponent(compilationlayout);

    //Output console
    outputConsole = createOutputConsole();
    mainLayout.addComponent(outputConsole);

    addonsNotFoundLabel = createAddonsNotFoundLabel();
}

From source file:com.arcusys.liferay.vaadinplugin.ControlPanelUI.java

License:Apache License

private VerticalLayout createIncludeAddonsListLayout(OptionGroup includeAddonsOptionGroup) {
    VerticalLayout addonsListHolder = new VerticalLayout();
    addonsListHolder.setCaption("Select Add-ons");

    addonsListHolder.addComponent(includeAddonsOptionGroup);
    return addonsListHolder;
}

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

License:Apache License

public AdditionalDependenciesWindow(List<File> files, List<File> includedDependencies) {
    setCaption("Additional dependencies (WEB-INF/lib)");
    setWidth("350px");
    setHeight("350px");

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();/*from  w w w.  j  a  v a 2  s.  c om*/
    layout.setMargin(true);
    layout.setSpacing(true);
    setContent(layout);

    dependencyContainer.addContainerProperty("caption", String.class, null);

    filterTextField = createFilterTextField();
    layout.addComponent(filterTextField);

    dependenciesSelector = createDependenciesSelector();
    populateSelector(files, includedDependencies);
    layout.addComponent(dependenciesSelector);
    layout.setExpandRatio(dependenciesSelector, 1);

    layout.addComponent(createCloseButton());
}

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

License:Apache License

private Layout createVaadinDetails() {

    Layout vaadinDetailLayout = new VerticalLayout();
    vaadinDetailLayout.setWidth("900px");

    VerticalLayout vaadinDetails = new VerticalLayout();
    vaadinDetails.setMargin(new MarginInfo(true, true, false, true));

    Version currentVersion = ControlPanelPortletUtil.getPortalVaadinVersion();
    VaadinVersion currentVaadinInfo = VaadinVersion.getVaadinVersion(currentVersion);
    Collection<VaadinFileInfo> fileInfos = currentVaadinInfo.getVaadinFilesInfo();

    Collections.sort((List<VaadinFileInfo>) fileInfos, new Comparator<VaadinFileInfo>() {
        @Override//  ww  w .j  a  v  a2s . c  o m
        public int compare(VaadinFileInfo o1, VaadinFileInfo o2) {
            if (o1 == null)
                return -1;
            if (o2 == null)
                return 1;
            return o1.getOrderPriority().compareTo(o2.getOrderPriority());
        }
    });

    for (VaadinFileInfo info : fileInfos) {
        VerticalLayout infoLayout = new VerticalLayout();
        infoLayout.setCaption(info.getName());

        infoLayout.setMargin(new MarginInfo(false, true, true, false));

        Layout versionLayout = new HorizontalLayout();
        versionLayout.setSizeUndefined();
        versionLayout.addComponent(new Label("Version: "));
        String vaadinJarVersion;
        try {
            vaadinJarVersion = ControlPanelPortletUtil.getPortalVaadinJarVersion(
                    info.getPlace() + ControlPanelPortletUtil.FileSeparator + info.getName());
        } catch (Exception ex) {
            vaadinJarVersion = "";
            log.warn("Version for " + vaadinJarVersion + " couldn't be read.", ex);
        }

        versionLayout.addComponent(new Label(vaadinJarVersion));

        infoLayout.addComponent(versionLayout);

        Layout pathLayout = new HorizontalLayout();

        pathLayout.setSizeUndefined();
        pathLayout.addComponent(new Label("Path: "));
        String path = info.getPlace();
        pathLayout.addComponent(new Label(path));

        infoLayout.addComponent(pathLayout);

        vaadinDetails.addComponent(infoLayout);
    }

    vaadinDetailLayout.addComponent(vaadinDetails);
    return vaadinDetailLayout;
}

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

License:Apache License

public OutputConsole(String caption) {
    Panel panel = new Panel();
    panel.setCaption(caption);//  w  w  w  .j  av a  2 s.  co m
    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.before.vaadin.ui.MainUI.java

@Override
public void init(VaadinRequest request) {

    VerticalLayout mainarea = new VerticalLayout();

    Navigator navigator = new Navigator(this, mainarea);
    navigator.addProvider(viewProvider);
    navigator.setErrorView(CustomerView.class);

    setContent(new VerticalLayout(menu.getBasicMenu(), mainarea));
}

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

public Window transferEmployee(final String employeeId, final ComboBox div, final ComboBox dept,
        final TextField post) {
    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setMargin(true);/*  w w  w .java  2s .c o  m*/
    vlayout.setSpacing(true);

    final Window subWindow = new Window("Transfer Employee", vlayout);
    subWindow.setWidth("200px");

    final ComboBox division = new ComboBox("Division: ");
    division.setWidth("100%");
    dropDownBoxList.populateBranchComboBox(division);
    subWindow.addComponent(division);

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

    });
    subWindow.addComponent(department);

    final TextField position = createTextField("Position: ");
    position.setWidth("100%");
    subWindow.addComponent(position);

    final PopupDateField entryDate = (PopupDateField) createDateField("Date of Entry: ");
    subWindow.addComponent(entryDate);

    Button updateButton = new Button("UPDATE");
    updateButton.setWidth("100%");
    updateButton.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (division.getValue() == null) {
                getWindow().showNotification("Select Division!", Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            if (department.getValue() == null) {
                getWindow().showNotification("Select Department!", Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            if (position.getValue() == null || position.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Enter Position!", Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            if (entryDate.getValue() == null) {
                getWindow().showNotification("Select Entry Date!", Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            List<EmployeePositionHistory> ephList = new ArrayList<EmployeePositionHistory>();
            EmployeePositionHistory eph = new EmployeePositionHistory();
            eph.setBranch(division.getValue().toString());
            eph.setDepartment(department.getValue().toString());
            eph.setPosition(position.getValue().toString().trim().toLowerCase());
            eph.setEntryDate(conUtil.convertDateFormat(entryDate.getValue().toString()));
            ephList.add(eph);
            Integer deptId = departmentDAO.getDepartmentId(divisionId, department.getValue().toString());
            Boolean result = employeeInformationDAO.transferEmployee(ephList, deptId);
            if (result) {
                Object divObjectId = div.addItem();
                div.setItemCaption(divObjectId, division.getValue().toString());
                div.setValue(divObjectId);

                Object deptObjectId = dept.addItem();
                dept.setItemCaption(deptObjectId, department.getValue().toString());
                dept.setValue(deptObjectId);

                post.setValue(position.getValue().toString().trim().toLowerCase());

                (subWindow.getParent()).removeWindow(subWindow);
            } else {
                getWindow().showNotification("Cannot Transfer employee",
                        Window.Notification.TYPE_ERROR_MESSAGE);
            }
        }
    });
    subWindow.addComponent(updateButton);

    return subWindow;
}

From source file:com.blogspot.markogronroos.MainUI.java

License:GNU General Public License

@Override
protected void init(VaadinRequest request) {

    final VerticalLayout main = new VerticalLayout();
    main.setMargin(true);//from   w ww . jav  a  2s .  c o  m
    setContent(main);

    //Window main = new Window("Test Application");

    // Create a menu bar
    final MenuBar menubar = new MenuBar();
    main.addComponent(menubar);

    // A feedback component
    final Label selection = new Label("-");
    main.addComponent(selection);

    MenuBar.MenuItem menuitem1 = menubar.addItem("JPA Examples", null, null);

    MenuBar.MenuItem menuitem2 = menuitem1.addItem("Other Example", null, null);

    MenuBar.Command mycommand = new MenuBar.Command() {
        @Override
        public void menuSelected(MenuBar.MenuItem selectedItem) {
            selection.setValue("Ordered a " + selectedItem.getText() + " from menu.");
            String selectedText = selectedItem.getText();
            if (selectedText.contains("1.1"))
                jpaContTable(main);
            else if (selectedText.contains("1.2"))
                jpaContTable2(main);
            else if (selectedText.contains("1.3"))
                jpaContForm1(main);
            else if (selectedText.contains("1.4"))
                pureJPAExample(main);
            //selectedItem.
        }
    };

    menuitem1.addItem("1.1 demo JPAContainer Table component", null, mycommand);
    menuitem1.addItem("1.2 demo JPAContainer Table component, explicit EntityManager", null, mycommand);
    menuitem1.addItem("1.3 demo JPAContainer Form", null, mycommand);

    menuitem1.addItem("1.4 demo JPA batch", null, mycommand);
    //menuitem1.addItem(menuitem2);

    // Define a common menu command for all the menu items.

    //  initEx2(request);
}