Example usage for com.vaadin.ui AbstractSplitPanel setFirstComponent

List of usage examples for com.vaadin.ui AbstractSplitPanel setFirstComponent

Introduction

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

Prototype

public void setFirstComponent(Component c) 

Source Link

Document

Sets the first component of this split panel.

Usage

From source file:org.opennms.features.jmxconfiggenerator.webui.ui.mbeans.MBeansView.java

License:Open Source License

private AbstractSplitPanel initMainPanel(Component first, Component second) {
    AbstractSplitPanel layout = new HorizontalSplitPanel();
    layout.setSizeFull();//w w  w .  j  av  a  2  s  .  co  m
    layout.setLocked(false);
    layout.setSplitPosition(20, UNITS_PERCENTAGE);
    layout.setFirstComponent(first);
    layout.setSecondComponent(second);
    layout.setCaption(first.getCaption());
    return layout;
}

From source file:org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.MBeansView.java

License:Open Source License

private AbstractSplitPanel initMainPanel(Tree first, Component second) {
    AbstractSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();/*from  w w w. j a v a  2s.  co m*/
    splitPanel.setLocked(false);
    splitPanel.setSplitPosition(25, Unit.PERCENTAGE);

    splitPanel.setFirstComponent(first);
    splitPanel.setSecondComponent(second);
    splitPanel.setCaption(first.getCaption());
    return splitPanel;
}

From source file:org.semanticsoft.vaaclipse.presentation.renderers.SashRenderer.java

License:Open Source License

public void generateSplitPanelStructure(MPartSashContainer sash) {
    VerticalLayout layout = (VerticalLayout) sash.getWidget();
    layout.removeAllComponents();//from www . j  a va  2 s  . c  om

    ComponentContainer sashWidget = null;

    @SuppressWarnings("unchecked")
    List<MPartSashContainerElement> renderableAndVisible = (List<MPartSashContainerElement>) filterRenderableAndVisibleElements(
            sash);

    if (renderableAndVisible.isEmpty()) {
        sashWidget = new VerticalLayout();
    } else if (renderableAndVisible.size() == 1) {
        sashWidget = new VerticalLayout();
        MPartSashContainerElement child = renderableAndVisible.get(0);
        sashWidget.addComponent((Component) child.getWidget());
    } else {
        sashWidget = sash.isHorizontal() ? new SashWidgetHorizontal() : new SashWidgetVertical();
        AbstractSplitPanel currentSashWidget = (AbstractSplitPanel) sashWidget;
        currentSashWidget.setLocked(sash.getTags().contains(Tags.NO_RESIZE));
        for (int i = 0; i < renderableAndVisible.size(); i++) {
            MPartSashContainerElement child = renderableAndVisible.get(i);

            if (currentSashWidget.getFirstComponent() == null) {
                currentSashWidget.setFirstComponent((Component) child.getWidget());
            } else {
                if (i == renderableAndVisible.size() - 1) {
                    currentSashWidget.setSecondComponent((Component) child.getWidget());
                } else {
                    AbstractSplitPanel newSashWidget = sash.isHorizontal() ? new SashWidgetHorizontal()
                            : new SashWidgetVertical();
                    newSashWidget.setLocked(sash.getTags().contains(Tags.NO_RESIZE));
                    newSashWidget.setFirstComponent((Component) child.getWidget());
                    currentSashWidget.setSecondComponent(newSashWidget);
                    currentSashWidget = newSashWidget;
                }
            }
        }
    }

    sashWidget.setSizeFull();
    layout.addComponent(sashWidget);

    setWeights(sash);
}