/** * Adds the given components to this layout and sets them as expanded. The * width of all added child components are set to 100% so that the expansion * will be effective. The width 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 (getWidth() < 0) { setWidth(100, Unit.PERCENTAGE); } for (Component child : components) { child.setWidth(100, Unit.PERCENTAGE); setExpandRatio(child, 1); } }
Component createTopRow() { Label spacer = new Label(); spacer.setWidthUndefined(); HorizontalLayout topRow = new HorizontalLayout( spacer, name, concept, apparentAge ); topRow.setExpandRatio(spacer, 1); topRow.setSpacing( true ); topRow.setWidth( 100, Unit.PERCENTAGE ); return topRow; }
protected Component headerRow() { HorizontalLayout headerRow = new HorizontalLayout(header, localeCombo, userStatus); headerRow.setWidth("100%"); headerRow.setExpandRatio(header, 1f); return headerRow; }
protected void headerRow() { headerRow = new HorizontalLayout(header, localeSelector.getComponent(), userStatus); headerRow.setWidth("100%"); headerRow.setExpandRatio(header, 1f); }
private HorizontalLayout createTitleBar() { HorizontalLayout titleBar = new HorizontalLayout(); Label title = new Label("EHCACHE DETAIL"); titleBar.addComponent(title); titleBar.setExpandRatio(title, 1.0f); // Expand title.addStyleNames(ValoTheme.LABEL_H1, ValoTheme.LABEL_BOLD, ValoTheme.LABEL_COLORED); return titleBar; }
private HorizontalLayout createTitleBar() { HorizontalLayout titleBar = new HorizontalLayout(); Label title = new Label("EHCACHE LIST"); titleBar.addComponent(title); titleBar.setExpandRatio(title, 1.0f); title.addStyleNames(ValoTheme.LABEL_H1, ValoTheme.LABEL_BOLD, ValoTheme.LABEL_COLORED); return titleBar; }
protected void initTitle(HorizontalLayout headerLayout) { title = new Label(i18nManager.getMessage(Messages.TASK_PEOPLE)); title.addStyleName(ExplorerLayout.STYLE_H3); title.setWidth(100, UNITS_PERCENTAGE); headerLayout.addComponent(title); headerLayout.setExpandRatio(title, 1.0f); }
private HorizontalLayout getCaptionLayout() { final HorizontalLayout captionLayout = new HorizontalLayout(); captionLayout.setSizeFull(); captionLayout.setHeight("36px"); captionLayout.addComponents(windowCaption, closeButton); captionLayout.setExpandRatio(windowCaption, 1.0F); captionLayout.addStyleName("v-window-header"); return captionLayout; }
private HorizontalLayout getCaptionLayout() { final HorizontalLayout captionLayout = new HorizontalLayout(); captionLayout.setSizeFull(); captionLayout.setHeight("36px"); captionLayout.addComponents(windowCaption, closeButton); captionLayout.setExpandRatio(windowCaption, 1.0F); captionLayout.addStyleName("v-window-header"); return captionLayout; }
@Override public Component initContent() { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); layout.addComponent(oidType); layout.addComponent(oidValue); layout.setExpandRatio(oidValue, 1); return layout; }
protected void initTitle(HorizontalLayout headerLayout) { title = new Label(i18nManager.getMessage(Messages.TASK_SUBTASKS)); title.addStyleName(ExplorerLayout.STYLE_H3); title.setWidth(100, UNITS_PERCENTAGE); headerLayout.addComponent(title); headerLayout.setExpandRatio(title, 1.0f); }
public static HorizontalLayout horizontalLayout(com.vaadin.ui.Component c1, com.vaadin.ui.Component c2) { HorizontalLayout hl = new HorizontalLayout(); hl.setWidth(100, Sizeable.UNITS_PERCENTAGE); hl.setSpacing(true); hl.addComponent(c1); hl.addComponent(c2); hl.setComponentAlignment(c2, Alignment.TOP_RIGHT); hl.setExpandRatio(c1, 1.0f); return hl; }
private HorizontalLayout createLayout() { HorizontalLayout layout = new HorizontalLayout(); layout.setStyleName("main-screen"); layout.addComponent(this.menu); layout.addComponent(this.container); layout.setExpandRatio(this.container, 1); layout.setSizeFull(); layout.setSpacing(true); layout.setHeight(3000, Unit.PIXELS); return layout; }
public HorizontalLayout createControls(String itemsPerPageCaption, String pageCaption) { HorizontalLayout pageSize = createPageSizeControls(itemsPerPageCaption); HorizontalLayout pageManagement = createPageManagementControls(pageCaption); HorizontalLayout controlBar = new HorizontalLayout(); controlBar.addComponent(pageSize); controlBar.addComponent(pageManagement); controlBar.setComponentAlignment(pageManagement, Alignment.MIDDLE_CENTER); controlBar.setWidth("100%"); controlBar.setExpandRatio(pageSize, 1); return controlBar; }
@Override protected void init(VaadinRequest vaadinRequest) { getPage().setTitle(StringUtils.isEmpty(this.title) ? "Application" : this.title); final HorizontalLayout rootLayout = new HorizontalLayout(); rootLayout.setSizeFull(); setContent(rootLayout); rootLayout.addComponent(getSideBar()); rootLayout.addComponent(getDisplayView()); rootLayout.setExpandRatio(getDisplayView(), 1.0f); }
/** * Initializes the lower left component {@link #m_lowerLeftComponent} with the correctly placed "Add key"-label. */ private void initLowerLeftComponent() { HorizontalLayout placeHolderLowerLeft = new HorizontalLayout(); placeHolderLowerLeft.setWidth("100%"); Label newKeyLabel = new Label(m_messages.key(Messages.GUI_CAPTION_ADD_KEY_0)); newKeyLabel.setWidthUndefined(); HorizontalLayout lowerLeft = new HorizontalLayout(placeHolderLowerLeft, newKeyLabel); lowerLeft.setWidth("100%"); lowerLeft.setExpandRatio(placeHolderLowerLeft, 1f); m_lowerLeftComponent = lowerLeft; }
protected void initComponentLayout() { selectedComponentLayout = new GridLayout(1,2); selectedComponentLayout.setSizeFull(); selectedComponentLayout.setMargin(true); selectedComponentLayout.setSpacing(true); selectedComponentLayout.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_CREATE_DETAIL); windowLayout.addComponent(selectedComponentLayout); windowLayout.setExpandRatio(selectedComponentLayout, 1.0f); selectedComponentLayout.setRowExpandRatio(0, 1.0f); selectedComponentLayout.setColumnExpandRatio(0, 1.0f); }
protected void initInformationPanel() { Panel infoPanel = new Panel(); infoPanel.addStyleName(Reindeer.PANEL_LIGHT); infoPanel.setSizeFull(); profilePanelLayout.addComponent(infoPanel); profilePanelLayout.setExpandRatio(infoPanel, 1.0f); // info panel should take all the remaining width available // All the information sections are put under each other in a vertical layout this.infoPanelLayout = new VerticalLayout(); infoPanel.setContent(infoPanelLayout); initAboutSection(); initContactSection(); }
protected void showOverview(boolean setLinking) { if (menuLeave != null) menuLeave.setEnabled(false); contentScreen.removeAllComponents(); cleanupMenu(); currentSpace = null; contentScreen.addComponent(overView); contentScreen.setExpandRatio(overView, 1f); menuHistory.setText(MNls.find(this, "menu.history=History")); if (setLinking) UI.getCurrent().getPage().setUriFragment(""); }
private void createSaveButton() { saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON, i18n.getMessage(UIMessageIdProvider.BUTTON_SAVE), "", "", true, FontAwesome.SAVE, SPUIButtonStyleNoBorderWithIcon.class); saveButton.setSizeUndefined(); saveButton.addStyleName("default-color"); addCloseListenerForSaveButton(); saveButton.setEnabled(false); saveButton.setClickShortcut(KeyCode.ENTER); buttonsLayout.addComponent(saveButton); buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT); buttonsLayout.setExpandRatio(saveButton, 1.0F); }