Example usage for com.vaadin.ui HorizontalLayout setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

From source file:org.apache.usergrid.chop.webapp.view.main.MainView.java

License:Apache License

private HorizontalLayout addButtons() {
    HorizontalLayout horizontalLayout = new HorizontalLayout();

    /**      Modules Button    */
    Button modules = new Button("Modules");
    horizontalLayout.addComponent(modules);
    modules.addClickListener(new Button.ClickListener() {
        @Override//from   w w  w  .j  a  va 2  s. co m
        public void buttonClick(Button.ClickEvent clickEvent) {
            tabSheetManager.addTabWithVerticalLayout(new ModuleLayout(MainView.this), "Modules");
        }
    });

    /**      Runners Button    */
    Button runners = new Button("Runners");
    horizontalLayout.addComponent(runners);
    runners.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            tabSheetManager.addTabWithVerticalLayout(new RunnersLayout(), "Runners");
        }
    });

    /**      Users Button    */
    Button users = new Button("Users");
    horizontalLayout.addComponent(users);
    users.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            UI.getCurrent().addWindow(new UserListWindow(tabSheetManager));
        }
    });

    /**      Logs Button    */
    Button logs = new Button("Logs");
    horizontalLayout.addComponent(logs);
    logs.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            tabSheetManager.addTabWithVerticalLayout(new LogLayout(), "Logs");
        }
    });

    /**      Logout Button    */
    Button logout = new Button("Logout");
    horizontalLayout.addComponent(logout);
    logout.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            ShiroRealm.logout();
            redirectToMainView();
        }
    });
    float weight = logout.getHeight();
    horizontalLayout.setHeight(String.valueOf(weight));
    return horizontalLayout;
}

From source file:org.balisunrise.vaadin.components.header.Header.java

private void init() {
    setStyleName("b-header");
    setHeight("41px");
    setWidth("100%");

    // parte da esquerda
    HorizontalLayout leftPart = new HorizontalLayout();
    leftPart.setSizeUndefined();/* w  ww  .j  a v a 2s  .c  o m*/
    leftPart.setHeight("100%");
    addComponent(leftPart);

    programName = new Label("Spilumba Cervejaria");
    programName.setStyleName("b-program-name");
    leftPart.addComponent(programName);

    fastMenuBar = new FastMenuBar();
    leftPart.addComponent(fastMenuBar);

    searchInput = new SearchInput();
    leftPart.addComponent(searchInput);

    moduleButton = new ModuleButton();
    leftPart.addComponent(moduleButton);

    // parte central do menu
    moduleMenu = new ModuleMenu();
    addComponent(moduleMenu);
    setComponentAlignment(moduleMenu, Alignment.MIDDLE_CENTER);

    // parte direita
    userBar = new UserBar();
    addComponent(userBar);
    setComponentAlignment(userBar, Alignment.TOP_RIGHT);
}

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadProgressInfoWindow.java

License:Open Source License

private HorizontalLayout getCaptionLayout() {
    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();//from  w w  w .  j a va 2 s . c om
    captionLayout.setHeight("36px");
    captionLayout.addComponents(windowCaption, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");
    return captionLayout;
}

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadStatusInfoWindow.java

License:Open Source License

private HorizontalLayout getCaptionLayout() {
    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();//from   w  w w  . ja va2  s .  com
    captionLayout.setHeight("36px");
    captionLayout.addComponents(windowCaption, minimizeButton, resizeButton, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");
    return captionLayout;
}

From source file:org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout.java

License:Open Source License

private void buildLayout() {
    final HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    headerLayout.setSpacing(false);/*w w w  . j  a  v a  2 s  .  c  o m*/
    headerLayout.setMargin(false);
    headerLayout.setSizeFull();
    headerLayout.addComponent(headerCaption);
    if (hasCreatePermission()) {
        headerLayout.addComponents(addIcon);
        headerLayout.setComponentAlignment(addIcon, Alignment.MIDDLE_RIGHT);
    }
    headerLayout.setExpandRatio(headerCaption, 1.0F);

    final HorizontalLayout headerWrapperLayout = new HorizontalLayout();
    headerWrapperLayout
            .addStyleName("bordered-layout" + " " + "no-border-bottom" + " " + "metadata-table-margin");
    headerWrapperLayout.addComponent(headerLayout);
    headerWrapperLayout.setWidth("100%");
    headerLayout.setHeight("30px");

    final VerticalLayout tableLayout = new VerticalLayout();
    tableLayout.setSizeFull();
    tableLayout.setHeight("100%");
    tableLayout.addComponent(headerWrapperLayout);
    tableLayout.addComponent(metaDataGrid);
    tableLayout.addStyleName("table-layout");
    tableLayout.setExpandRatio(metaDataGrid, 1.0F);

    final VerticalLayout metadataFieldsLayout = createMetadataFieldsLayout();

    mainLayout = new HorizontalLayout();
    mainLayout.addComponent(tableLayout);
    mainLayout.addComponent(metadataFieldsLayout);
    mainLayout.setExpandRatio(tableLayout, 0.5F);
    mainLayout.setExpandRatio(metadataFieldsLayout, 0.5F);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    setCompositionRoot(mainLayout);
    setSizeFull();
}

From source file:org.eclipse.hawkbit.ui.common.grid.AbstractGridHeader.java

License:Open Source License

private void buildLayout() {
    final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout();
    titleFilterIconsLayout.addComponents(headerCaptionLayout);

    if (isAllowSearch() && isRollout()) {
        titleFilterIconsLayout.addComponents(searchField, searchResetIcon);
        titleFilterIconsLayout.setExpandRatio(headerCaptionLayout, 0.3F);
        titleFilterIconsLayout.setExpandRatio(searchField, 0.7F);
    }/* w w w. j  a va  2s  . c om*/
    if (hasCreatePermission() && isRollout()) {
        titleFilterIconsLayout.addComponent(addButton);
        titleFilterIconsLayout.setComponentAlignment(addButton, Alignment.TOP_LEFT);
    }
    if (showCloseButton()) {
        titleFilterIconsLayout.addComponent(closeButton);
        titleFilterIconsLayout.setComponentAlignment(closeButton, Alignment.TOP_RIGHT);
    }

    titleFilterIconsLayout.setHeight("40px");
    addComponent(titleFilterIconsLayout);
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");
}

From source file:org.eclipse.hawkbit.ui.filtermanagement.TargetFilterHeader.java

License:Open Source License

private void buildLayout() {
    final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout();
    titleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon);
    if (permissionChecker.hasCreateTargetPermission()) {
        titleFilterIconsLayout.addComponent(createfilterButton);
        titleFilterIconsLayout.setComponentAlignment(createfilterButton, Alignment.TOP_LEFT);
    }//  w  ww . j  ava2  s.c  o m
    titleFilterIconsLayout.setExpandRatio(headerCaption, 0.3F);
    titleFilterIconsLayout.setExpandRatio(searchField, 0.7F);
    titleFilterIconsLayout.setHeight("40px");
    addComponent(titleFilterIconsLayout);
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");

}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private HorizontalLayout buildHlMetaViews() {
    // common part: create layout
    HorizontalLayout hlMetaViews = new HorizontalLayout();
    hlMetaViews.setImmediate(false);//from w  w  w.  j  ava 2 s . c  o m
    hlMetaViews.setWidth("100.0%");
    hlMetaViews.setHeight("100.0%");
    hlMetaViews.setMargin(false);

    // leftPanel
    Panel leftPanel = buildLeftPanel();
    hlMetaViews.addComponent(leftPanel);
    hlMetaViews.setExpandRatio(leftPanel, 4.5f);

    // rightPanel
    Panel rightPanel = buildRightPanel();
    hlMetaViews.addComponent(rightPanel);
    hlMetaViews.setExpandRatio(rightPanel, 5.5f);

    return hlMetaViews;
}

From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java

License:Open Source License

public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndLabelData(final String labelTxt,
        Property dataProperty, boolean required) {
    Preconditions.checkNotNull(labelTxt, "Label is null");
    Preconditions.checkNotNull(dataProperty, "DataSource is null");
    HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeUndefined();
    horizontalLayout.setDescription(USER_DESCR_ON_HOR_LAYOUT_TO_EDIT);
    horizontalLayout.setEnabled(true);//from   w ww  .  j  a  va 2 s.  c o  m
    horizontalLayout.setSpacing(true);
    horizontalLayout.setHeight(HOR_PANEL_HEIGHT);
    Label label = new Label();
    label.setWidth(LABEL_WIDTH);
    label.setValue(DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END);
    label.setContentMode(Label.CONTENT_XHTML);
    label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT);
    Label textLabel = new Label(dataProperty);
    textLabel.setWidth(TEXT_WIDTH);
    textLabel.setDescription(USER_DESCR_ON_LABEL_TO_EDIT);
    textLabel.setStyleName(STYLE_ELABS_TEXT_AS_LABEL);
    horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL);
    horizontalLayout.addComponent(label, 0);
    horizontalLayout.addComponent(textLabel, 1);
    horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
    horizontalLayout.setComponentAlignment(textLabel, Alignment.MIDDLE_RIGHT);
    return horizontalLayout;
}

From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java

License:Open Source License

public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndStaticComboData(final String labelTxt,
        String value, boolean required) {
    Preconditions.checkNotNull(labelTxt, "Label is null");
    HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeUndefined();
    horizontalLayout.setDescription(USER_DESCR_ON_HOR_LAYOUT_TO_EDIT);
    horizontalLayout.setEnabled(true);//w  w w.  ja  v  a2s  .  com
    horizontalLayout.setSpacing(true);
    horizontalLayout.setHeight(HOR_PANEL_HEIGHT);
    Label label = new Label();
    label.setWidth(LABEL_WIDTH);
    label.setValue(DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END);
    label.setContentMode(Label.CONTENT_XHTML);
    label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT);
    Label textLabel = new Label(value);
    textLabel.setWidth(TEXT_WIDTH);
    textLabel.setDescription(USER_DESCR_ON_LABEL_TO_EDIT);
    textLabel.setStyleName(STYLE_ELABS_TEXT_AS_LABEL);
    horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL);
    horizontalLayout.addComponent(label, 0);
    horizontalLayout.addComponent(textLabel, 1);
    horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
    horizontalLayout.setComponentAlignment(textLabel, Alignment.MIDDLE_RIGHT);
    return horizontalLayout;
}