Example usage for com.vaadin.ui HorizontalSplitPanel setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

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

License:Apache License

public SplitPanels() {
    setMargin(true);//from   w w  w  . j  av a  2s  .  c om

    Label h1 = new Label("Split Panels");
    h1.addStyleName("h1");
    addComponent(h1);

    addComponent(new Label(
            "Outlines are just to show the areas of the SplitPanels. They are not part of the actual component style."));

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName("wrapping");
    row.setSpacing(true);
    row.setMargin(new MarginInfo(true, false, false, false));
    addComponent(row);

    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setCaption("Default style");
    sp.setWidth("400px");
    sp.setHeight(null);
    sp.setFirstComponent(getContent());
    sp.setSecondComponent(getContent());
    row.addComponent(sp);

    VerticalSplitPanel sp2 = new VerticalSplitPanel();
    sp2.setCaption("Default style");
    sp2.setWidth("300px");
    sp2.setHeight("200px");
    sp2.setFirstComponent(getContent());
    sp2.setSecondComponent(getContent());
    row.addComponent(sp2);

    sp = new HorizontalSplitPanel();
    sp.setCaption("Large style");
    sp.setWidth("300px");
    sp.setHeight("200px");
    sp.addStyleName("large");
    sp.setFirstComponent(getContent());
    sp.setSecondComponent(getContent());
    row.addComponent(sp);

    sp2 = new VerticalSplitPanel();
    sp2.setCaption("Large style");
    sp2.setWidth("300px");
    sp2.setHeight("200px");
    sp2.addStyleName("large");
    sp2.setFirstComponent(getContent());
    sp2.setSecondComponent(getContent());
    row.addComponent(sp2);
}

From source file:com.oodrive.nuage.webui.VvrManagerUi.java

License:Apache License

/**
 * Add a VVR user interface.//from w ww . j  a v a 2s .  com
 * 
 * @param vvrUuid
 *            the vvr unique identifier
 * 
 */
public final void addVvr(final UUID vvrUuid) {

    // Create a vvr model
    final VvrModel vvrModel = jmxHandler.createVvrModel(vvrUuid);
    vvrModels.put(vvrUuid, vvrModel);

    // Layout for the first component
    final VerticalLayout vvrLayout = new VerticalLayout();
    vvrLayout.setWidth("100%");

    vvrsTabsheet.addTab(vvrLayout, vvrModel.getVvrName(), null, vvrsTabsheet.getComponentCount() - 1);
    vvrLayouts.put(vvrUuid, vvrLayout);

    // Create component for vvr operations
    final VvrOperationComponent op = new VvrOperationComponent(vvrManagerModel);
    final AbstractComponent opComponent = op.createComponent(vvrModel, jmxHandler);
    opComponent.setHeight(opLayoutHeight);
    vvrLayout.addComponent(opComponent);

    final Label label = new Label("&nbsp", ContentMode.HTML);
    label.setHeight(labelLayoutHeight);
    vvrLayout.addComponent(label);
    vvrLayout.addComponent(new Label("<hr />", ContentMode.HTML));

    // Create Tool tip for attributes
    final VvrAttributesComponent attr = new VvrAttributesComponent(vvrUuid);
    vvrsTabsheet.getTab(vvrLayout).setDescription(attr.createComponent(vvrModel));

    // If there was only the + sheet, select the new vvr sheet
    if (vvrsTabsheet.getComponentCount() == 2) {
        vvrsTabsheet.setSelectedTab(0);
    }

    // Create its panel
    final HorizontalSplitPanel panel = new HorizontalSplitPanel();
    vvrLayout.addComponent(panel);
    panel.setWidth("100%");
    panel.setHeight(panelLayoutHeight);
    panel.setSplitPosition(35);

    // Component to display snapshot/device atributes
    final VerticalLayout vvrTreeLayout = new VerticalLayout();
    final VvrTreeComponent vvrTreeComponent = new VvrTreeComponent(vvrTreeLayout);
    panel.setFirstComponent(vvrTreeComponent.createComponent(vvrModel, jmxHandler));
    panel.setSecondComponent(vvrTreeLayout);

    vvrTreeComponents.put(vvrUuid, vvrTreeComponent);
}

From source file:com.vaushell.treetasker.application.window.UserWindow.java

License:Open Source License

/**
 * Displays the user's view.//ww  w  .  j a v a  2s . c  o  m
 */
public void setUserView() {
    mainLayout.removeComponent(controller.getLoginLayout());

    mainLayout.addComponent(controller.getActionBar());

    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setWidth("1000px");
    splitPanel.setHeight("100%");
    splitPanel.setSplitPosition(30);
    splitPanel.setLocked(true);
    splitPanel.setMargin(true);
    splitPanel.setStyleName("content");
    splitPanel.addComponent(controller.getTree());
    splitPanel.addComponent(controller.getContent());

    controller.refresh();

    mainLayout.addComponent(splitPanel);
    mainLayout.setExpandRatio(splitPanel, 1);
    mainLayout.setComponentAlignment(splitPanel, Alignment.TOP_CENTER);
}