List of usage examples for com.vaadin.ui ComponentContainer setSizeFull
public void setSizeFull();
From source file:com.freebox.engeneering.application.web.common.ApplicationLayout.java
License:Apache License
/** * Initializes view layout when system enters 'initView' action state. */*from w w w . java2 s. c o m*/ * @param event - state event. */ public void initView(@SuppressWarnings("rawtypes") StateEvent event) { final HorizontalLayout content = new HorizontalLayout(); content.setSizeFull(); content.setStyleName("main-view"); final HorizontalSplitPanel leftSplitPanel = new HorizontalSplitPanel(); leftSplitPanel.setSplitPosition(20, Sizeable.Unit.PERCENTAGE); final ComponentContainer leftSideBar = createPlaceholder(StateLayout.LEFT_SIDE_BAR); leftSideBar.setSizeFull(); content.addComponent(leftSideBar, 0); final VerticalLayout verticalLayoutContent = new VerticalLayout(); verticalLayoutContent.setStyleName("freebox-view"); verticalLayoutContent.addComponent(createPlaceholder(StateLayout.HEADER)); verticalLayoutContent.setSpacing(true); final ComponentContainer layoutContent = createPlaceholder(StateLayout.CONTENT); layoutContent.setSizeFull(); verticalLayoutContent.addComponent(layoutContent); verticalLayoutContent.setSizeFull(); //verticalLayoutContent.addComponent(createPlaceholder(StateLayout.FOOTER)); verticalLayoutContent.setExpandRatio(layoutContent, 8f); content.addComponent(verticalLayoutContent, 1); content.setExpandRatio(leftSideBar, 1.0f); content.setExpandRatio(verticalLayoutContent, 9f); setView(content); }
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 w w w. jav a 2s .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); }
From source file:ro.zg.netcell.vaadin.action.application.OpenEntityWithUpstreamHierarchy.java
License:Apache License
@Override public void handle(ActionContext actionContext) throws Exception { OpenGroupsApplication app = actionContext.getApp(); Entity selectedEntity = actionContext.getEntity(); UserAction ua = actionContext.getUserAction(); Map<String, Object> params = ua.getActionParams(); params.putAll(selectedEntity.getFilterValues()); params.put("pageNumber", 1); /* we need to bring all the hierarchy and display it on the same page */ params.put("itemsOnPage", 5000); params.put("entityId", selectedEntity.getId()); params.put("withContent", true); params.put("userId", app.getCurrentUserId()); ComponentContainer container = actionContext.getTargetContainer(); container.removeAllComponents();// www . j a va2s .com container.setSizeFull(); // VerticalLayout hierarchyContainer = new VerticalLayout(); CssLayout hierarchyContainer = new CssLayout(); hierarchyContainer.setSizeFull(); container.addComponent(hierarchyContainer); displayHierarchyList(selectedEntity, ua, app, hierarchyContainer, params); // VerticalLayout entityContainer = new VerticalLayout(); CssLayout entityContainer = new CssLayout(); container.addComponent(entityContainer); getActionsManager().executeAction(ActionsManager.OPEN_ENTITY_WITH_ACTIONS, selectedEntity, app, entityContainer, false, actionContext); }