Example usage for com.vaadin.ui HorizontalLayout setWidth

List of usage examples for com.vaadin.ui HorizontalLayout setWidth

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:com.save.reports.reimbursement.ReimbursementReportUI.java

public ReimbursementReportUI() {
    setSizeFull();/* w  w  w  .  j  a  v  a 2 s  .  c  o  m*/

    addComponent(mrDataGrid);
    setExpandRatio(mrDataGrid, 1);

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setSpacing(true);
    h.setMargin(new MarginInfo(false, true, true, false));

    Button filter = new CommonButton("FILTER");
    filter.setWidth("200px");
    filter.addClickListener(this);
    h.addComponent(filter);
    h.setComponentAlignment(filter, Alignment.MIDDLE_RIGHT);
    h.setExpandRatio(filter, 1);

    Button print = new CommonButton("EXPORT TO EXCEL");
    print.setWidth("200px");
    print.addClickListener(this);
    h.addComponent(print);
    h.setComponentAlignment(print, Alignment.MIDDLE_RIGHT);

    addComponent(h);
}

From source file:com.save.reports.reimbursement.ReimbursementReportUI.java

private Window filterReport() {
    Window sub = new Window("FILTER REPORT");
    sub.setWidth("400px");
    sub.setModal(true);/*from w  ww  . j  a  v  a2 s.  c o  m*/
    sub.center();

    FormLayout f = new FormLayout();
    f.setWidth("100%");
    f.setMargin(true);
    f.setSpacing(true);

    CheckBox employeeCheckBox = new CheckBox("Filter by Employee");
    f.addComponent(employeeCheckBox);

    CheckBox amountCheckBox = new CheckBox("Filter by Amount");
    f.addComponent(amountCheckBox);

    CheckBox dateCheckBox = new CheckBox("Filter by Date");
    f.addComponent(dateCheckBox);

    ComboBox employeeComboBox = CommonComboBox.getAllEmpployees(null);
    employeeComboBox.setEnabled(false);
    f.addComponent(employeeComboBox);
    employeeCheckBox.addValueChangeListener((Property.ValueChangeEvent e) -> {
        employeeComboBox.setEnabled((boolean) e.getProperty().getValue());
        isEmployee = (boolean) e.getProperty().getValue();
    });

    TextField amountField = new CommonTextField("Amount: ");
    amountField.addStyleName("align-right");
    amountField.setEnabled(false);
    f.addComponent(amountField);
    amountCheckBox.addValueChangeListener((Property.ValueChangeEvent e) -> {
        amountField.setEnabled((boolean) e.getProperty().getValue());
        isAmount = (boolean) e.getProperty().getValue();
    });

    HorizontalLayout h = new HorizontalLayout();
    h.setCaption("Date: ");
    h.setWidth("100%");
    h.setSpacing(true);

    DateField from = new DateField();
    from.setWidth("100%");
    from.setEnabled(false);
    h.addComponent(from);

    DateField to = new DateField();
    to.setWidth("100%");
    to.setEnabled(false);
    h.addComponent(to);

    dateCheckBox.addValueChangeListener((Property.ValueChangeEvent e) -> {
        from.setEnabled((boolean) e.getProperty().getValue());
        to.setEnabled((boolean) e.getProperty().getValue());
        isDate = (boolean) e.getProperty().getValue();
    });

    f.addComponent(h);

    Button generate = new CommonButton("Generate Report");
    generate.addClickListener((Button.ClickEvent e) -> {
        if (!isEmployee && !isAmount && !isDate) {
            mrDataGrid.setContainerDataSource(new ReimbursementDataContainer());
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (isEmployee && !isAmount && !isDate) {
            if (employeeComboBox.getValue() == null) {
                Notification.show("Select a Client!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            mrDataGrid.setContainerDataSource(
                    new ReimbursementDataContainer(employeeComboBox.getValue().toString()));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (!isEmployee && isAmount && !isDate) {
            if (amountField.getValue() == null || amountField.getValue().trim().isEmpty()) {
                Notification.show("Enter Amount!", Notification.Type.ERROR_MESSAGE);
                return;
            } else {
                if (!CommonUtilities.checkInputIfDouble(amountField.getValue().trim())) {
                    Notification.show("Enter numeric format for Amount!", Notification.Type.ERROR_MESSAGE);
                    return;
                }
            }

            mrDataGrid.setContainerDataSource(new ReimbursementDataContainer(
                    CommonUtilities.convertStringToDouble(amountField.getValue().trim())));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (!isEmployee && !isAmount && isDate) {
            if (from.getValue() == null) {
                Notification.show("Select first Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (to.getValue() == null) {
                Notification.show("Select 2nd Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            mrDataGrid.setContainerDataSource(new ReimbursementDataContainer(from.getValue(), to.getValue()));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (isEmployee && isAmount && !isDate) {
            if (employeeComboBox.getValue() == null) {
                Notification.show("Select a Client!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (amountField.getValue() == null || amountField.getValue().trim().isEmpty()) {
                Notification.show("Enter Amount!", Notification.Type.ERROR_MESSAGE);
                return;
            } else {
                if (!CommonUtilities.checkInputIfDouble(amountField.getValue().trim())) {
                    Notification.show("Enter numeric format for Amount!", Notification.Type.ERROR_MESSAGE);
                    return;
                }
            }

            mrDataGrid.setContainerDataSource(
                    new ReimbursementDataContainer(employeeComboBox.getValue().toString(),
                            CommonUtilities.convertStringToDouble(amountField.getValue().trim())));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (isEmployee && !isAmount && isDate) {
            if (employeeComboBox.getValue() == null) {
                Notification.show("Select a Client!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (from.getValue() == null) {
                Notification.show("Select first Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (to.getValue() == null) {
                Notification.show("Select 2nd Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            mrDataGrid.setContainerDataSource(new ReimbursementDataContainer(
                    employeeComboBox.getValue().toString(), from.getValue(), to.getValue()));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (!isEmployee && isAmount && isDate) {
            if (amountField.getValue() == null || amountField.getValue().trim().isEmpty()) {
                Notification.show("Enter Amount!", Notification.Type.ERROR_MESSAGE);
                return;
            } else {
                if (!CommonUtilities.checkInputIfDouble(amountField.getValue().trim())) {
                    Notification.show("Enter numeric format for Amount!", Notification.Type.ERROR_MESSAGE);
                    return;
                }
            }

            if (from.getValue() == null) {
                Notification.show("Select first Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (to.getValue() == null) {
                Notification.show("Select 2nd Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            mrDataGrid.setContainerDataSource(new ReimbursementDataContainer(
                    CommonUtilities.convertStringToDouble(amountField.getValue().trim()), from.getValue(),
                    to.getValue()));
            mrDataGrid.setFrozenColumnCount(2);
        }

        if (isEmployee && isAmount && isDate) {
            if (employeeComboBox.getValue() == null) {
                Notification.show("Select a Client!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (amountField.getValue() == null || amountField.getValue().trim().isEmpty()) {
                Notification.show("Enter Amount!", Notification.Type.ERROR_MESSAGE);
                return;
            } else {
                if (!CommonUtilities.checkInputIfDouble(amountField.getValue().trim())) {
                    Notification.show("Enter numeric format for Amount!", Notification.Type.ERROR_MESSAGE);
                    return;
                }
            }

            if (from.getValue() == null) {
                Notification.show("Select first Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            if (to.getValue() == null) {
                Notification.show("Select 2nd Date!", Notification.Type.ERROR_MESSAGE);
                return;
            }

            mrDataGrid.setContainerDataSource(
                    new ReimbursementDataContainer(employeeComboBox.getValue().toString(),
                            CommonUtilities.convertStringToDouble(amountField.getValue().trim()),
                            from.getValue(), to.getValue()));
            mrDataGrid.setFrozenColumnCount(2);
        }

        sub.close();
    });
    f.addComponent(generate);

    sub.setContent(f);
    sub.getContent().setHeightUndefined();

    return sub;
}

From source file:com.selzlein.lojavirtual.vaadin.core.NavigationMenu.java

License:Open Source License

private void buildTopMenu() {
    final HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName("valo-menu-title");
    final Label title = new Label("<h3>LSPS <strong>ProcessApplication</strong></h3>", ContentMode.HTML);
    title.setSizeUndefined();/*from  w w  w  .j av  a 2  s .c  o  m*/
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    this.addComponent(top);

    final NavigationMenu menuWrapp = this;
    final Button showMenu = new Button("Menu", new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            if (menuWrapp.getStyleName().contains("valo-menu-visible")) {
                menuWrapp.removeStyleName("valo-menu-visible");
            } else {
                menuWrapp.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    this.addComponent(showMenu);
}

From source file:com.selzlein.lojavirtual.vaadin.page.SettingsView.java

License:Open Source License

private void createView() {
    ui = (LspsUI) getUI();/*from  w ww . j a  v  a2s.com*/
    user = ui.getUser().getPerson();
    userRights = user.getRights();

    setTitle(ui.getMessage(TITLE));

    Panel panel = new Panel();
    panel.addStyleName("l-border-none");
    setContent(panel);

    VerticalLayout layout = new VerticalLayout();
    layout.addStyleName("l-settings");
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setMargin(true);
    panel.setContent(layout);

    //user data and settings will be laid out next to each other
    HorizontalLayout topSection = new HorizontalLayout();
    topSection.setSpacing(true);
    topSection.setWidth("100%");
    layout.addComponent(topSection);

    VerticalLayout userData = createUserDataSection(ui, user);
    topSection.addComponent(userData);
    topSection.setExpandRatio(userData, 1);

    Label spacer = new Label();
    spacer.setWidth("20px");
    topSection.addComponent(spacer);

    VerticalLayout settings = createSettingsSection(ui);
    topSection.addComponent(settings);
    topSection.setExpandRatio(settings, 1);

    //substitution section
    VerticalLayout substitution = createSubstitutionSection();
    layout.addComponent(substitution);
    layout.setExpandRatio(substitution, 2);

    //buttons
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    Button saveButton = new Button(ui.getMessage("action.save"), new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (save()) {
                if (requestReload) {
                    JavaScript.getCurrent().execute("window.location.reload()");
                } else {
                    close();
                }
            }
        }
    });
    saveButton.setData(BUTTON_TYPE_SAVE);
    buttons.addComponent(saveButton);
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
    layout.addComponent(buttons);
}

From source file:com.selzlein.lojavirtual.vaadin.page.TodoListView.java

License:Open Source License

@SuppressWarnings("serial")
@Override/*from w  ww  .j a v  a 2s  .c  om*/
protected Component createHeader(Component titleComponent) {
    LspsUI ui = (LspsUI) getUI();

    actionBtn = new MenuBar();
    actionBtn.addStyleName("menu-button-action");
    actionBtn.setVisible(false); //initially hidden
    MenuItem actions = actionBtn.addItem("", null, null);

    final ViewAction refreshTodos = new ViewAction() {

        @Override
        public void invoke() {
            toggleSelectionMode(false);
            container.refresh();
        }
    };

    actions.addItem(ui.getMessage("action.lock"), new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            lock();
        }
    });
    actions.addItem(ui.getMessage("action.annotate") + "...", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            getUI().addWindow(new TodoAnnotation(getSelectedTodoIds(), refreshTodos));
        }
    });
    actions.addSeparator();
    actions.addItem(ui.getMessage("action.unlock"), new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            unlock();
        }
    });
    actions.addItem(ui.getMessage("action.reject") + "...", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            getUI().addWindow(new TodoRejection(getSelectedTodoIds(), refreshTodos));
        }
    });
    actions.addItem(ui.getMessage("action.delegate") + "...", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            getUI().addWindow(new TodoDelegation(getSelectedTodoIds(), refreshTodos));
        }
    });
    actions.addItem(ui.getMessage("action.escalate") + "...", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            getUI().addWindow(new TodoEscalation(getSelectedTodoIds(), refreshTodos));
        }
    });

    selectBtn = new Button(ui.getMessage("action.select"), new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            toggleSelectionMode(true);
        }
    });
    selectBtn.addStyleName("menu-button");

    cancelBtn = new Button(ui.getMessage("action.cancel"), new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            toggleSelectionMode(false);
        }
    });
    cancelBtn.setVisible(false); //initially hidden
    cancelBtn.addStyleName("menu-button");

    titleComponent.addStyleName("l-content-title");

    HorizontalLayout layout = new HorizontalLayout();
    HorizontalLayout btnLayout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.addComponent(titleComponent);
    layout.addComponent(btnLayout);
    layout.setSpacing(true);
    btnLayout.addComponent(actionBtn);
    btnLayout.addComponent(cancelBtn);
    btnLayout.addComponent(selectBtn);
    layout.setComponentAlignment(btnLayout, Alignment.MIDDLE_RIGHT);
    return layout;
}

From source file:com.siemens.ct.osgi.vaadin.pm.main.MainApplication.java

License:Open Source License

private Layout getHeader() {
    HorizontalLayout header = new HorizontalLayout();
    header.setWidth("100%");
    header.setMargin(true);// ww  w . j  a  va 2  s .  c om
    header.setSpacing(true);
    // header.setStyleName(Reindeer.LAYOUT_BLACK);

    CssLayout titleLayout = new CssLayout();
    H2 title = new H2("Dynamic Vaadin OSGi Demo");
    titleLayout.addComponent(title);
    SmallText description = new SmallText(
            "Select the \"Bundle View\" tab and activate/stop OSGi bundles dynamically.");
    description.setSizeUndefined();
    titleLayout.addComponent(description);

    header.addComponent(titleLayout);

    return header;
}

From source file:com.skysql.manager.ui.CalendarDialog.java

License:Open Source License

/**
 * Inits the layout content.// w w w.j  a v a  2  s .  co  m
 */
private void initLayoutContent() {
    initNavigationButtons();
    initAddNewEventButton();
    initHideWeekEndButton();
    //initAllScheduleButton();

    HorizontalLayout hl = new HorizontalLayout();
    hl.setWidth("100%");
    hl.setSpacing(true);
    hl.setMargin(new MarginInfo(false, false, true, false));
    hl.addComponent(prevButton);
    hl.addComponent(captionLabel);
    hl.addComponent(monthButton);
    hl.addComponent(weekButton);
    hl.addComponent(nextButton);
    hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT);
    hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(monthButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(weekButton, Alignment.MIDDLE_CENTER);
    hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT);

    monthButton.setVisible(viewMode == Mode.WEEK);
    weekButton.setVisible(viewMode == Mode.DAY);

    HorizontalLayout controlPanel = new HorizontalLayout();
    controlPanel.setSpacing(true);
    controlPanel.setMargin(new MarginInfo(false, false, true, false));
    controlPanel.setWidth("100%");
    //controlPanel.addComponent(localeSelect);
    //controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT);
    controlPanel.addComponent(timeZoneSelect);
    controlPanel.setComponentAlignment(timeZoneSelect, Alignment.MIDDLE_LEFT);
    //controlPanel.addComponent(formatSelect);
    //controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT);
    controlPanel.addComponent(addNewEvent);
    controlPanel.setComponentAlignment(addNewEvent, Alignment.BOTTOM_LEFT);
    controlPanel.addComponent(hideWeekendsButton);
    controlPanel.setComponentAlignment(hideWeekendsButton, Alignment.BOTTOM_LEFT);
    //controlPanel.addComponent(allScheduleButton);
    //controlPanel.setComponentAlignment(allScheduleButton, Alignment.MIDDLE_LEFT);

    VerticalLayout layout = (VerticalLayout) dialogWindow.getContent();
    layout.addComponent(controlPanel);
    layout.addComponent(hl);
    layout.addComponent(calendarComponent);
    layout.setExpandRatio(calendarComponent, 1);
}

From source file:com.skysql.manager.ui.components.ComponentButton.java

License:Open Source License

/**
 * Instantiates a new component button./*from w  ww  .ja v a2s. co m*/
 *
 * @param componentInfo the component info
 */
public ComponentButton(ClusterComponent componentInfo) {
    thisButton = this;
    this.componentInfo = componentInfo;

    addStyleName("componentButton");

    componentInfo.setButton(this);
    setData(componentInfo);

    setHeight(COMPONENT_HEIGHT + 4, Unit.PIXELS);
    float componentWidth = (componentInfo.getType() == ClusterComponent.CCType.system) ? SYSTEM_WIDTH
            : NODE_WIDTH;
    setWidth(componentWidth + 8, Unit.PIXELS);

    imageLayout = new VerticalLayout();
    imageLayout.setHeight(COMPONENT_HEIGHT + 4, Unit.PIXELS);
    imageLayout.setWidth(componentWidth, Unit.PIXELS);
    //imageLayout.setMargin(new MarginInfo(true, true, false, true));
    imageLayout.setImmediate(true);

    if (componentInfo.getParentID() != null) {
        String icon = null;
        switch (componentInfo.getType()) {
        case system:
            icon = "system";
            break;

        case node:
            icon = NodeStates.getNodeIcon(componentInfo.getSystemType(), componentInfo.getState());
            break;

        default:
            // unknown component type
            break;
        }
        imageLayout.addStyleName(icon);
        //imageLayout.addStyleName(componentInfo.getType().toString());

        commandLabel = new Label();
        commandLabel.setSizeUndefined();
        imageLayout.addComponent(commandLabel);
        imageLayout.setComponentAlignment(commandLabel, Alignment.TOP_LEFT);
        //imageLayout.setExpandRatio(commandLabel, 1.0f);
        //            NodeInfo nodeInfo = (NodeInfo) componentInfo;
        //            TaskRecord taskRecord = nodeInfo.getTask();
        //            setCommandLabel(taskRecord);

        Label padding = new Label("");
        imageLayout.addComponent(padding);
        imageLayout.setComponentAlignment(padding, Alignment.MIDDLE_CENTER);

        HorizontalLayout iconsStrip = new HorizontalLayout();
        iconsStrip.addStyleName("componentInfo");
        iconsStrip.setWidth(componentInfo.getType() == ClusterComponent.CCType.node ? "60px" : "76px");
        imageLayout.addComponent(iconsStrip);
        imageLayout.setComponentAlignment(iconsStrip, Alignment.MIDDLE_CENTER);

        info = new Embedded(null, new ThemeResource("img/info.png"));
        iconsStrip.addComponent(info);
        iconsStrip.setComponentAlignment(info, Alignment.MIDDLE_LEFT);

        alert = new Embedded();
        alert.setVisible(false);
        iconsStrip.addComponent(alert);
        iconsStrip.setComponentAlignment(alert, Alignment.MIDDLE_RIGHT);

        nameLabel = new Label(componentInfo.getName());
        nameLabel.setStyleName("componentName");
        nameLabel.setSizeUndefined();
        imageLayout.addComponent(nameLabel);
        imageLayout.setComponentAlignment(nameLabel, Alignment.BOTTOM_CENTER);

    }
    addComponent(imageLayout);
    setComponentAlignment(imageLayout, Alignment.TOP_CENTER);
    setExpandRatio(imageLayout, 1.0f);

}

From source file:com.skysql.manager.ui.components.SystemLayout.java

License:Open Source License

/**
 * Instantiates a new system layout.//from  w  w  w.  j av  a2s . co m
 *
 * @param systemRecord the system record
 */
public SystemLayout(SystemRecord systemRecord) {

    addStyleName("systemLayout");
    setWidth(Sizeable.SIZE_UNDEFINED, Sizeable.Unit.PERCENTAGE);
    setMargin(new MarginInfo(false, true, false, false));

    final HorizontalLayout systemHeader = new HorizontalLayout();
    systemHeader.addStyleName("panelHeaderLayout");
    systemHeader.setSpacing(true);
    systemHeader.setWidth("100%");
    systemHeader.setHeight("23px");
    addComponent(systemHeader);

    backButton = new NativeButton();
    backButton.setStyleName("backButton");
    backButton.setDescription("Back to Systems");
    systemHeader.addComponent(backButton);
    backButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {

            VaadinSession session = getSession();
            SystemInfo systemInfo = session.getAttribute(SystemInfo.class);
            OverviewPanel overviewPanel = session.getAttribute(OverviewPanel.class);
            ComponentButton button = systemInfo.getCurrentSystem().getButton();
            String parentID = systemInfo.getCurrentSystem().getParentID();
            systemInfo.setCurrentSystem(parentID);
            session.setAttribute(SystemInfo.class, systemInfo);
            ManagerUI.log("new systemID: " + parentID);
            overviewPanel.clickLayout(button, false);
            overviewPanel.refresh();
        }

    });

    final Label systemLabel = new Label("Systems");
    systemLabel.setSizeUndefined();
    systemHeader.addComponent(systemLabel);
    systemHeader.setComponentAlignment(systemLabel, Alignment.MIDDLE_LEFT);
    systemHeader.setExpandRatio(systemLabel, 1.0f);

    systemSlot = new HorizontalLayout();
    addComponent(systemSlot);

    // initialize System button
    refresh(null, null);

}

From source file:com.skysql.manager.ui.OverviewPanel.java

License:Open Source License

/**
 * Instantiates a new overview panel./*w  w  w  . ja v a2s. c  o m*/
 */
public OverviewPanel() {

    HorizontalLayout overviewContainer = new HorizontalLayout();
    overviewContainer.addStyleName("overviewPanel");
    overviewContainer.setWidth("100%");
    setContent(overviewContainer);

    systemInfo = VaadinSession.getCurrent().getAttribute(SystemInfo.class);
    systemRecord = systemInfo.getCurrentSystem();
    systemLayout = new SystemLayout(systemRecord);
    overviewContainer.addComponent(systemLayout);

    VerticalLayout nodesSlot = new VerticalLayout();
    nodesSlot.addStyleName("nodesSlot");
    nodesSlot.setMargin(new MarginInfo(false, false, false, false));
    overviewContainer.addComponent(nodesSlot);
    overviewContainer.setExpandRatio(nodesSlot, 1.0f);

    final HorizontalLayout nodesHeader = new HorizontalLayout();
    nodesHeader.setStyleName("panelHeaderLayout");
    nodesHeader.setWidth("100%");
    nodesSlot.addComponent(nodesHeader);
    nodesLabel = new Label(" ");
    nodesLabel.setSizeUndefined();
    nodesHeader.addComponent(nodesLabel);
    nodesHeader.setComponentAlignment(nodesLabel, Alignment.MIDDLE_CENTER);
    nodesHeader.setExpandRatio(nodesLabel, 1.0f);

    final HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    buttonsLayout.setMargin(new MarginInfo(false, true, false, false));
    nodesHeader.addComponent(buttonsLayout);
    nodesHeader.setComponentAlignment(buttonsLayout, Alignment.MIDDLE_RIGHT);

    addSystemButton = new Button("Add System...");
    addSystemButton.setDescription("Add System");
    addSystemButton.setVisible(false);
    buttonsLayout.addComponent(addSystemButton);
    addSystemButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            new SystemDialog(null, null);
        }
    });

    addNodeButton = new Button("Add Node...");
    addNodeButton.setDescription("Add Node to the current System");
    addNodeButton.setVisible(false);
    buttonsLayout.addComponent(addNodeButton);
    addNodeButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            new NodeDialog(null, null);
        }
    });

    final Button editButton = new Button("Edit");
    editButton.setDescription("Enter Editing mode");
    final Button saveButton = new Button("Done");
    saveButton.setDescription("Exit Editing mode");
    buttonsLayout.addComponent(editButton);

    editButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            buttonsLayout.replaceComponent(editButton, saveButton);
            isEditable = true;
            systemLayout.setEditable(true);
            nodesLayout.setEditable(true);
            nodesHeader.setStyleName("panelHeaderLayout-editable");
            if (systemRecord != null && !SystemInfo.SYSTEM_ROOT.equals(systemRecord.getID())) {
                addNodeButton.setVisible(true);
            } else {
                addSystemButton.setVisible(true);
            }
            if (systemRecord == null || (systemRecord != null && systemRecord.getNodes().length == 0)) {
                nodesLayout.placeholderLayout(null);
            }
        }
    });

    saveButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            buttonsLayout.replaceComponent(saveButton, editButton);
            isEditable = false;
            systemLayout.setEditable(false);
            nodesLayout.setEditable(false);
            nodesHeader.setStyleName("panelHeaderLayout");
            if (systemRecord != null && systemRecord.getNodes().length == 0) {
                nodesLayout.placeholderLayout(null);
            }
            addNodeButton.setVisible(false);
            addSystemButton.setVisible(false);
        }
    });

    Panel panel = new Panel();
    panel.setHeight(PANEL_HEIGHT, Unit.PIXELS);
    panel.addStyleName(Runo.PANEL_LIGHT);
    nodesSlot.addComponent(panel);

    nodesLayout = new NodesLayout(systemRecord);
    nodesLayout.addStyleName("nodesLayout");
    nodesLayout.setWidth("100%");
    panel.setContent(nodesLayout);

}