/** * 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); } } }
@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 ColorPickerPopup() { // Set the layout layout = new VerticalLayout(); layout.setSpacing(false); layout.setMargin(false); layout.setWidth("100%"); layout.setHeight(null); setContent(layout); setStyleName(STYLENAME); setResizable(false); // Create the history history = new ColorPickerHistory(); history.addValueChangeListener(this::colorChanged); }
@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; }
@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 protected void init(VaadinRequest request) { VerticalLayout layout = new VerticalLayout(); setContent(layout); // Add this layout.setHeight("100%"); // The rest is the same ...
private void setPopupSizeInMinMode() { mainLayout.setWidth(900, Unit.PIXELS); mainLayout.setHeight(510, Unit.PIXELS); }
private void setPopupSizeInMinMode() { mainLayout.setWidth(900, Unit.PIXELS); mainLayout.setHeight(510, Unit.PIXELS); }
public void setHeight(int height) { if (height < 0) return; VerticalLayout innerLayout = (VerticalLayout) getContent(); /*if (!isFull)*/ innerLayout.setHeight(height,Unit.PIXELS); this.height = height; doRememberSize(new int[] {width,height,isFull?1:0}); }
public void setHeight(int height) { if (height < 0) return; VerticalLayout innerLayout = (VerticalLayout) getMainWindow().getContent(); /*if (!isFull)*/ innerLayout.setHeight(height,Sizeable.UNITS_PIXELS); this.height = height; doRememberSize(new int[] {width,height,isFull?1:0}); }
protected void initImagePanel() { imageLayout = new VerticalLayout(); imageLayout.setSpacing(true); imageLayout.setHeight("100%"); profilePanelLayout.addComponent(imageLayout); initPicture(); }
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 static VerticalLayout getMenuLayout() { final VerticalLayout menuContent = new VerticalLayout(); menuContent.addStyleName(ValoTheme.MENU_PART); menuContent.addStyleName("sidebar"); menuContent.addStyleName("no-vertical-drag-hints"); menuContent.addStyleName("no-horizontal-drag-hints"); menuContent.setWidth(null); menuContent.setHeight("100%"); return menuContent; }
private static VerticalLayout getMenuLayout() { final VerticalLayout menuContent = new VerticalLayout(); menuContent.addStyleName(ValoTheme.MENU_PART); menuContent.addStyleName("sidebar"); menuContent.addStyleName("no-vertical-drag-hints"); menuContent.addStyleName("no-horizontal-drag-hints"); menuContent.setWidth(null); menuContent.setHeight("100%"); return menuContent; }
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 getTokenFieldLayout() { final TokenField tokenField = targetBulkTokenTags.getTokenField(); final VerticalLayout tokenLayout = SPUIComponentProvider.getDetailTabLayout(); tokenLayout.addStyleName("bulk-target-tags-layout"); tokenLayout.addComponent(tokenField); tokenLayout.setSpacing(false); tokenLayout.setMargin(false); tokenLayout.setSizeFull(); tokenLayout.setHeight("100px"); tokenLayout.setId(UIComponentIdProvider.BULK_UPLOAD_TAG); return tokenLayout; }
private VerticalLayout getTokenFieldLayout() { final TokenField tokenField = targetBulkTokenTags.getTokenField(); final VerticalLayout tokenLayout = SPUIComponentProvider.getDetailTabLayout(); tokenLayout.addStyleName("bulk-target-tags-layout"); tokenLayout.addComponent(tokenField); tokenLayout.setSpacing(false); tokenLayout.setMargin(false); tokenLayout.setSizeFull(); tokenLayout.setHeight("100px"); tokenLayout.setId(UIComponentIdProvider.BULK_UPLOAD_TAG); return tokenLayout; }
private ColorPickerPopup() { // Set the layout layout = new VerticalLayout(); layout.setSpacing(false); layout.setMargin(false); layout.setWidth("100%"); layout.setHeight(null); setContent(layout); setStyleName(STYLENAME); setResizable(false); // Create the history history = new ColorPickerHistory(); history.addColorChangeListener(this); }
protected void init() { addStyleName(ValoTheme.PANEL_BORDERLESS); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setWidth("100%"); verticalLayout.setHeight("100%"); verticalLayout.setMargin(true); this.chartLayout.setSizeFull(); this.chartLayout.addComponent(buildExclusionsChart()); verticalLayout.addComponent(this.chartLayout); this.setSizeFull(); this.setContent(verticalLayout); }