List of usage examples for com.vaadin.ui CssLayout addComponent
public void addComponent(Component c, int index)
From source file:org.semanticsoft.vaaclipse.presentation.renderers.TrimBarRenderer.java
License:Open Source License
@Override public void addChildGui(MUIElement child, MElementContainer<MUIElement> element) { if (!(child instanceof MTrimElement && (MElementContainer<?>) element instanceof MTrimBar)) return;/*from w w w . j a v a 2s . com*/ MTrimBar trimBar = (MTrimBar) (MElementContainer<?>) element; final Component childWidget = (Component) child.getWidget(); childWidget.setVisible(child.isVisible()); childWidget.setSizeUndefined(); int orientation = trimBar.getSide().getValue(); if (orientation == SideValue.TOP_VALUE || orientation == SideValue.BOTTOM_VALUE) childWidget.addStyleName("horizontaltrimelement"); else childWidget.addStyleName("verticaltrimelement"); int index = indexOf(child, element); if (element.getWidget() instanceof CssLayout) { CssLayout trimWidget = (CssLayout) element.getWidget(); trimWidget.addComponent(childWidget, index); trimWidget.markAsDirty(); } else if (element.getWidget() instanceof AbstractOrderedLayout) { AbstractOrderedLayout trimWidget = (AbstractOrderedLayout) element.getWidget(); trimWidget.addComponent(childWidget, index); trimWidget.markAsDirty(); } refreshVisibility(trimBar); }