Example usage for com.vaadin.ui HorizontalSplitPanel setWidth

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

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

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

License:Apache License

public SplitPanels() {
    setMargin(true);// w  w w.  jav a  2  s  .co m

    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.//w ww .  j a va 2  s  .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.//from   w ww . 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);
}

From source file:ru.codeinside.gses.webui.manager.DirectoryPanel.java

License:Mozilla Public License

static Component createDirectoryPanel() {
    HorizontalSplitPanel horSplit = new HorizontalSplitPanel();
    horSplit.setSizeFull();//from ww w.j  av a 2s . com
    horSplit.setMargin(true);

    Panel panel00 = new Panel();
    Panel panel01 = new Panel();

    Panel panel10 = new Panel();

    horSplit.setFirstComponent(panel00);

    VerticalLayout vl = new VerticalLayout();
    horSplit.setSecondComponent(vl);

    vl.addComponent(panel01);
    vl.addComponent(panel10);

    vl.setSpacing(true);

    horSplit.setWidth("100%");
    vl.setHeight("100%");

    panel00.setHeight("100%");
    panel00.setWidth("100%");

    panel01.setWidth("100%");
    panel01.setHeight("100%");
    panel10.setHeight("100%");
    horSplit.setSplitPosition(35);
    vl.setExpandRatio(panel01, 0.25f);
    vl.setExpandRatio(panel10, 0.75f);

    final Table dirMapTable = ManagerWorkplace.createDirectoryMapTable();
    final FilterTable directoryTable = ManagerWorkplace.createDirectoryTable();
    dirMapTable.setVisible(false);

    final Form createFieldForm = new Form();
    createFieldForm.setCaption(" ?  ?");

    final TextField keyField = new TextField("");
    keyField.setRequired(true);
    keyField.setMaxLength(254);
    createFieldForm.addField("key", keyField);

    final TextField valField = new TextField("");
    valField.setRequired(true);
    valField.setMaxLength(1022);
    createFieldForm.addField("val", valField);
    createFieldForm.setVisible(false);

    Button addButton = new Button("",
            new AddTupleButtonListener(createFieldForm, directoryTable, keyField, valField, dirMapTable));
    createFieldForm.addField("submit", addButton);

    directoryTable.addListener(new DirectoryTableChangeListener(createFieldForm, directoryTable, dirMapTable));

    ManagerWorkplace.buildContainer(directoryTable, createFieldForm, dirMapTable);
    directoryTable.setColumnHeaders(new String[] { "?", "", "" });

    final Form createDirectory = new Form();
    createDirectory.setCaption(" ?");
    final TextField field = new TextField("?");
    field.setRequired(true);
    field.setMaxLength(255);
    field.setRequiredError("  ?");
    createDirectory.addField("name", field);
    Button createButton = new Button("",
            new CreateDirectoryButtonListener(field, createDirectory, directoryTable));
    createDirectory.addField("submit", createButton);

    Panel loadPanel = new Panel();
    loadPanel.setCaption(" ?");

    UploadDirectory events = new UploadDirectory(directoryTable, dirMapTable);

    Upload c = new Upload("", events);
    c.addListener(events);

    c.setButtonCaption("");
    loadPanel.addComponent(c);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSizeFull();
    verticalLayout.setSpacing(true);
    verticalLayout.addComponent(loadPanel);
    verticalLayout.addComponent(createDirectory);
    verticalLayout.addComponent(directoryTable);

    panel00.addComponent(verticalLayout);

    panel01.addComponent(createFieldForm);

    dirMapTable.setSizeFull();
    dirMapTable.setPageLength(13);
    panel10.addComponent(dirMapTable);

    return horSplit;
}