/** * 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); } }
buttons.addComponent(ok); buttons.addComponent(cancel); buttons.setWidth("100%"); buttons.setHeight("30px"); buttons.setComponentAlignment(ok, Alignment.MIDDLE_CENTER);
public static HorizontalLayout horizontalLayout(String width, com.vaadin.ui.Component... components) { HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.setWidth(width); if (components != null) { for (com.vaadin.ui.Component c : components) { hl.addComponent(c); } } return hl; }
/** * Creates a sub-layout for the footer. * * @return the footer sub-layout. */ private Layout createFooterMessageComponent() { final HorizontalLayout footerLayout = new HorizontalLayout(); footerLayout.addComponent(getFooterMessageLabel()); footerLayout.setWidth(100, Unit.PERCENTAGE); return footerLayout; }
protected void headerRow() { headerRow = new HorizontalLayout(header, localeSelector.getComponent(), userStatus); headerRow.setWidth("100%"); headerRow.setExpandRatio(header, 1f); }
public static HorizontalLayout hl(com.vaadin.ui.Component... components) { HorizontalLayout hl = new HorizontalLayout(); hl.setWidth(100, Sizeable.UNITS_PERCENTAGE); hl.setSpacing(true); for (Component c : components) { hl.addComponent(c); } return hl; }
protected void initHeader() { HorizontalLayout headerLayout = new HorizontalLayout(); headerLayout.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(headerLayout); initTitle(headerLayout); initAddSubTaskPanel(headerLayout); }
protected void initDefinitions() { HorizontalLayout definitionsHeader = new HorizontalLayout(); definitionsHeader.setSpacing(true); definitionsHeader.setWidth(100, UNITS_PERCENTAGE); definitionsHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); addDetailComponent(definitionsHeader); initDefinitionTitle(definitionsHeader); definitionsLayout = new HorizontalLayout(); definitionsLayout.setWidth(100, UNITS_PERCENTAGE); addDetailComponent(definitionsLayout); initDefinitionsTable(); }
protected void initDefinitions() { HorizontalLayout definitionsHeader = new HorizontalLayout(); definitionsHeader.setSpacing(true); definitionsHeader.setWidth(100, UNITS_PERCENTAGE); definitionsHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); addDetailComponent(definitionsHeader); initDefinitionTitle(definitionsHeader); definitionsLayout = new HorizontalLayout(); definitionsLayout.setWidth(100, UNITS_PERCENTAGE); addDetailComponent(definitionsLayout); initDefinitionsTable(); }
protected void initHeader() { HorizontalLayout headerLayout = new HorizontalLayout(); headerLayout.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(headerLayout); initTitle(headerLayout); initAddPeopleButton(headerLayout); }
@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 Component addFoldersLabel(AbstractLayout layout, Label label) { HorizontalLayout l = new HorizontalLayout(); l.setMargin(new MarginInfo(false, true, false, true)); l.addComponent(label); l.setWidth(100, Unit.PERCENTAGE); layout.addComponent(l); return l; }
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; }
protected void initDescriptionAndClaimButton() { HorizontalLayout layout = new HorizontalLayout(); layout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK); layout.setWidth(100, UNITS_PERCENTAGE); layout.setSpacing(true); centralLayout.addComponent(layout); initClaimButton(layout); initDescription(layout); }
private Layout createMainArea(final String description) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setWidth(100, Unit.PERCENTAGE); Label label = new Label(description, ContentMode.PREFORMATTED); label.setWidth(100, Unit.PERCENTAGE); layout.addComponent(label); return layout; }
@Override public void init() { Window mainWindow = new Window(""); setMainWindow(mainWindow); mainWindow.removeAllComponents(); HorizontalLayout main = new HorizontalLayout(); main.setSpacing(true); main.setMargin(true); main.setWidth(100, Sizeable.UNITS_PERCENTAGE); mainWindow.setContent(main); }
protected void initButtons(I18nManager i18nManager) { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth(100, UNITS_PERCENTAGE); addComponent(buttonLayout); deployButton = new Button(i18nManager.getMessage(Messages.MODEL_DEPLOY_BUTTON_DEPLOY)); buttonLayout.addComponent(deployButton); buttonLayout.setComponentAlignment(deployButton, Alignment.BOTTOM_CENTER); }
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; }
protected void init() { this.setWidth("100%"); this.setHeight("100%"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setWidth("100%"); horizontalLayout.setHeight("100%"); horizontalLayout.setMargin(true); horizontalLayout.addComponent(new Label("I am the PROFILE panel!")); this.setContent(horizontalLayout); }
protected void createNameTextField(I18nManager i18nManager, VerticalLayout layout) { HorizontalLayout fieldLayout = new HorizontalLayout(); fieldLayout.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(fieldLayout); fieldLayout.addComponent(new Label(i18nManager.getMessage(Messages.REPORTING_SAVE_POPUP_NAME))); nameField = new TextField(); nameField.setWidth(250, UNITS_PIXELS); nameField.focus(); fieldLayout.addComponent(nameField); }