/** * Adds the given components to this layout and sets them as expanded. The * height of all added child components are set to 100% so that the * expansion will be effective. The height of this layout is also set to * 100% if it is currently undefined. * <p> * The components are added in the provided order to the end of this layout. * Any components that are already children of this layout will be moved to * new positions. * * @param components * the components to set, not <code>null</code> * @since 8.0 */ public void addComponentsAndExpand(Component... components) { addComponents(components); if (getHeight() < 0) { setHeight(100, Unit.PERCENTAGE); } for (Component child : components) { child.setHeight(100, Unit.PERCENTAGE); setExpandRatio(child, 1); } } }
final VerticalLayout screen = new VerticalLayout(); ... final VerticalLayout top = new VerticalLayout(); ... final VerticalLayout bot = new VerticalLayout(); ... // Set expand ratios screen.setExpandRatio(top, 3); screen.setExpandRatio(bot, 7);
public final void setFooter(Component footer) { if (this.footer != null) { layout.removeComponent(this.footer); } this.footer = footer; if (footer == null) { return; } this.layout.addComponent(footer); this.layout.setExpandRatio(footer, 0); } }
public final void setContent(Component newDialogContent) { if (dialogContent != null) { layout.removeComponent(dialogContent); } this.dialogContent = newDialogContent; if (newDialogContent == null) { return; } this.layout.addComponentAsFirst(this.dialogContent); this.layout.setExpandRatio(this.dialogContent, 1f); }
@Override public void setHeight(float height, Unit unit) { super.setHeight(height, unit); if (height > 0) { composition.setHeight("100%"); composition.setExpandRatio(tokenContainer, 1); tokenContainer.setHeight("100%"); } else { composition.setHeightUndefined(); composition.setExpandRatio(tokenContainer, 0); tokenContainer.setHeightUndefined(); } }
private void addNotYetExecutedLabel(VerticalLayout layout) { Label noException = new Label(i18nManager.getMessage(Messages.JOB_NOT_EXECUTED)); layout.addComponent(noException); layout.setExpandRatio(noException, 1.0f); }
@Override public MessageDialogBuilder withHeight(String height) { window.setHeight(height); if (getHeight() < 0) { messageLabel.setHeightUndefined(); layout.setExpandRatio(messageLabel, 0); layout.setHeightUndefined(); } else { messageLabel.setHeight(100, Sizeable.Unit.PERCENTAGE); layout.setHeight(100, Sizeable.Unit.PERCENTAGE); layout.setExpandRatio(messageLabel, 1); } return this; }
@Override public OptionDialogBuilder withHeight(String height) { window.setHeight(height); if (getHeight() < 0) { messageLabel.setHeightUndefined(); layout.setExpandRatio(messageLabel, 0); layout.setHeightUndefined(); } else { messageLabel.setHeight(100, Sizeable.Unit.PERCENTAGE); layout.setHeight(100, Sizeable.Unit.PERCENTAGE); layout.setExpandRatio(messageLabel, 1); } return this; }
protected void mainArea() { if (mainArea == null) { mainArea = new VerticalLayout(breadcrumb, getViewDisplayPanel(), subpage); mainArea.setSizeFull(); mainArea.setExpandRatio(getViewDisplayPanel(), 1f); } }
protected void mainArea() { if (mainArea == null) { mainArea = new VerticalLayout(breadcrumb, getViewDisplayPanel(), subpage); mainArea.setSizeFull(); mainArea.setExpandRatio(getViewDisplayPanel(), 1f); } }
private void addContentLayout() { m_layout = new VerticalLayout(); m_layout.setSizeFull(); m_rootLayout.addComponent(m_layout); m_rootLayout.setExpandRatio(m_layout, 1); updateWidgetView(); }
private Layout initContentPanel(NameEditForm form, MBeansContentTabSheet tabSheet) { VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setSpacing(false); layout.addComponent(form); layout.addComponent(tabSheet); layout.setExpandRatio(tabSheet, 1); return layout; }
VerticalLayout vlMain = new VerticalLayout(); vlMain.setSizeFull(); HorizontalLayout hlFooter = new HorizontalLayout(); hlFooter.setHeight("50px"); // if you want you can define a height. hlFooter.addComponent(new Label("Test1")); // adding a simple component. You might want to set alignment for that component vlMain.addComponent(mainComponent); vlMain.setExpandRatio(mainComponent, 1.0f); // "give" the main component the maximum available space vlMain.addComponent(hlFooter);
/** * Creates the main window and adds the header, main and button panels to * it. */ private void initMainLayout() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(headerPanel); layout.addComponent(contentPanel); layout.setSizeFull(); // content Panel should use most of the space layout.setExpandRatio(contentPanel, 1); setContent(layout); }
private Layout createContent(final String description) { VerticalLayout content = new VerticalLayout(); content.setWidth(100, Unit.PERCENTAGE); Layout footer = createFooter(); Layout mainArea = createMainArea(description); content.addComponent(mainArea); content.addComponent(footer); content.setExpandRatio(mainArea, 1); return content; }
protected VerticalLayout createMetadataFieldsLayout() { final VerticalLayout metadataFieldsLayout = new VerticalLayout(); metadataFieldsLayout.setSizeFull(); metadataFieldsLayout.setHeight("100%"); metadataFieldsLayout.addComponent(keyTextField); metadataFieldsLayout.addComponent(valueTextArea); metadataFieldsLayout.setSpacing(true); metadataFieldsLayout.setExpandRatio(valueTextArea, 1F); return metadataFieldsLayout; }
private Layout createContent(final String description) { VerticalLayout content = new VerticalLayout(); content.setWidth(100, Unit.PERCENTAGE); Layout footer = createFooter(); Layout mainArea = createMainArea(description); content.addComponent(mainArea); content.addComponent(footer); content.setExpandRatio(mainArea, 1); return content; }
protected VerticalLayout createMetadataFieldsLayout() { final VerticalLayout metadataFieldsLayout = new VerticalLayout(); metadataFieldsLayout.setSizeFull(); metadataFieldsLayout.setHeight("100%"); metadataFieldsLayout.addComponent(keyTextField); metadataFieldsLayout.addComponent(valueTextArea); metadataFieldsLayout.setSpacing(true); metadataFieldsLayout.setExpandRatio(valueTextArea, 1F); return metadataFieldsLayout; }
private VerticalLayout createDetailsAndUploadLayout() { detailAndUploadLayout = new VerticalLayout(); detailAndUploadLayout.addComponent(artifactDetailsLayout); detailAndUploadLayout.setComponentAlignment(artifactDetailsLayout, Alignment.TOP_CENTER); detailAndUploadLayout.setExpandRatio(artifactDetailsLayout, 1.0F); if (permChecker.hasCreateRepositoryPermission()) { detailAndUploadLayout.addComponent(dropAreaLayout.getDropAreaWrapper()); } detailAndUploadLayout.setSizeFull(); detailAndUploadLayout.addStyleName("group"); detailAndUploadLayout.setSpacing(true); return detailAndUploadLayout; }
VerticalLayout tab = new VerticalLayout(); tab.setSizeFull(); Table table = new Table(); table.setSizeFull(); tab.addComponent(table); tab.setExpandRatio(table, 1); HorizontalLayout buttons = new HorizontalLayout(); buttons.addComponent(new Button()); buttons.addComponent(new Button()); tab.addComponent(buttons); Tab tabOne = tabs.addTab(tab, "Tab One", null);