List of usage examples for com.vaadin.ui ComponentContainer setSizeUndefined
public void setSizeUndefined();
From source file:com.esofthead.mycollab.module.crm.view.lead.LeadConvertInfoWindow.java
License:Open Source License
public Layout initContent() { CssLayout contentLayout = new CssLayout(); contentLayout.setWidth("100%"); contentLayout.setStyleName("lead-convert-window"); contentLayout.addComponent(createBody()); ComponentContainer buttonControls = createButtonControls(); if (buttonControls != null) { final HorizontalLayout controlPanel = new HorizontalLayout(); buttonControls.setSizeUndefined(); controlPanel.addComponent(buttonControls); controlPanel.setWidth("100%"); controlPanel.setMargin(true);/*from w w w. j ava2s.co m*/ controlPanel.setComponentAlignment(buttonControls, Alignment.MIDDLE_CENTER); contentLayout.addComponent(controlPanel); } return contentLayout; }
From source file:org.semanticsoft.vaaclipse.presentation.renderers.TrimBarRenderer.java
License:Open Source License
@Override public void processContents(MElementContainer<MUIElement> container) { final MTrimBar trimBar = (MTrimBar) ((MElementContainer<?>) container); int orientation = trimBar.getSide().getValue(); AbstractLayout trimBarWidget = (AbstractLayout) container.getWidget(); if (orientation == SideValue.TOP_VALUE || orientation == SideValue.BOTTOM_VALUE) trimBarWidget.setHeight(-1, Unit.PIXELS); else//from w w w .jav a2 s . co m trimBarWidget.setWidth(-1, Unit.PIXELS); boolean isFirst = true; trimBarWidget.removeAllComponents(); for (MUIElement element : container.getChildren()) { if (element.isToBeRendered()) { ComponentContainer subToolbar = (ComponentContainer) element.getWidget(); subToolbar.setVisible(element.isVisible()); if (subToolbar != null) { if (orientation == SideValue.TOP_VALUE || orientation == SideValue.BOTTOM_VALUE) subToolbar.addStyleName("horizontaltrimelement"); else subToolbar.addStyleName("verticaltrimelement"); subToolbar.setSizeUndefined(); trimBarWidget.addComponent(subToolbar); isFirst = false; } } } //--- IEclipseContext ctx = getContext(container); final ExpressionContext eContext = new ExpressionContext(ctx); //visible when support for original trimbar elements (without contributed) for (final MTrimElement child : trimBar.getChildren()) { if (child.getVisibleWhen() != null) { ctx.runAndTrack(new RunAndTrack() { @Override public boolean changed(IEclipseContext context) { if (!trimBar.isToBeRendered() || !trimBar.isVisible() || trimBar.getWidget() == null) { return false; } final boolean rc = ContributionsAnalyzer.isVisible((MCoreExpression) child.getVisibleWhen(), eContext); execService.invokeLater(new Runnable() { @Override public void run() { child.setToBeRendered(rc); } }); return true; } }); } } //contributions ArrayList<MTrimContribution> toContribute = new ArrayList<MTrimContribution>(); ContributionsAnalyzer.gatherTrimContributions(trimBar, app.getTrimContributions(), trimBar.getElementId(), toContribute, eContext); addTrimContributions(trimBar, toContribute, ctx, eContext); refreshVisibility(trimBar); }