Refine search
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 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; }
private HorizontalLayout buildViewTitle() { final HorizontalLayout viewHeadercontent = new HorizontalLayout(); viewHeadercontent.setWidth("100%"); viewHeadercontent.addStyleName("view-header-layout"); viewTitle = new Label(); viewTitle.setWidth("100%"); viewTitle.setStyleName("header-content"); viewHeadercontent.addComponent(viewTitle); viewHeadercontent.addComponent(notificationUnreadButton); viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT); return viewHeadercontent; }
/** * 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); } }
layout.addComponent(tabs); VerticalLayout innerContainer = new VerticalLayout(); innerContainer.setWidth("100%"); innerContainer.setHeight(null); innerContainer.addComponent(history); resize.addClickListener(this::resizeButtonClick); resize.setData(false); resize.setWidth("100%"); resize.setHeight("10px"); resize.setPrimaryStyleName("resize-button"); cancel.addClickListener(this::cancelButtonClick); HorizontalLayout buttons = new HorizontalLayout(); buttons.addComponent(ok); buttons.addComponent(cancel); buttons.setWidth("100%"); buttons.setHeight("30px"); buttons.setComponentAlignment(ok, Alignment.MIDDLE_CENTER); buttons.setComponentAlignment(cancel, Alignment.MIDDLE_CENTER); layout.addComponent(buttons); setRgbSliderValues(selectedColor);
@SuppressWarnings("serial") private Component getInitialLayout() { VerticalLayout ret = new VerticalLayout(); // Buttons Button close = new Button(m_messageSourceAccessor.getMessage("close", "Close")); HorizontalLayout actions = new HorizontalLayout(); actions.setMargin(true); actions.setSpacing(true); actions.addComponent(close); close.addClickListener(new ClickListener(){ @Override public void buttonClick(ClickEvent event) { close(); }}); ret.addComponent(actions); return ret; }
private HorizontalLayout createTwinColumnLayout() { final HorizontalLayout twinColumnLayout = new HorizontalLayout(); twinColumnLayout.setSizeFull(); twinColumnLayout.setWidth("400px"); buildSourceTable(); buildSelectedTable(); final VerticalLayout selectButtonLayout = new VerticalLayout(); final Button selectButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SELECT_DIST_TYPE, "", "", "arrow-button", true, FontAwesome.FORWARD, SPUIButtonStyleNoBorder.class); selectButton.addClickListener(event -> addSMType()); final Button unSelectButton = SPUIComponentProvider.getButton("unselect-dist-type", "", "", "arrow-button", true, FontAwesome.BACKWARD, SPUIButtonStyleNoBorder.class); unSelectButton.addClickListener(event -> removeSMType()); selectButtonLayout.addComponent(selectButton); selectButtonLayout.addComponent(unSelectButton); selectButtonLayout.setComponentAlignment(selectButton, Alignment.MIDDLE_CENTER); selectButtonLayout.setComponentAlignment(unSelectButton, Alignment.MIDDLE_CENTER); twinColumnLayout.addComponent(sourceTable); twinColumnLayout.addComponent(selectButtonLayout); twinColumnLayout.addComponent(selectedTable); twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT); twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER); twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT); twinColumnLayout.setExpandRatio(sourceTable, 0.45F); twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F); twinColumnLayout.setExpandRatio(selectedTable, 0.48F); sourceTable.setVisibleColumns(DIST_TYPE_NAME); return twinColumnLayout; }
protected void createTableDrivenEditorChoice() { tableEditorLayout = new HorizontalLayout(); tableEditorLayout.setWidth("300px"); tableEditorLayout.addStyleName(ExplorerLayout.STYLE_CLICKABLE); addComponent(tableEditorLayout); tableEditorButton = new Button(); tableEditorButton.setIcon(Images.PROCESS_EDITOR_TABLE); tableEditorButton.setStyleName(Reindeer.BUTTON_LINK); tableEditorLayout.addComponent(tableEditorButton); tableEditorLayout.setComponentAlignment(tableEditorButton, Alignment.MIDDLE_LEFT); VerticalLayout tableEditorTextLayout = new VerticalLayout(); tableEditorLayout.addComponent(tableEditorTextLayout); tableEditorLayout.setExpandRatio(tableEditorTextLayout, 1.0f); tableEditorLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE)); tableEditorLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE); tableEditorTextLayout.addComponent(tableEditorLabel); tableEditorDescriptionLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE_DESCRIPTION)); tableEditorDescriptionLabel.addStyleName(Reindeer.LABEL_SMALL); tableEditorDescriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE); tableEditorTextLayout.addComponent(tableEditorDescriptionLabel); tableEditorLayout.addListener(new LayoutClickListener() { public void layoutClick(LayoutClickEvent event) { preferTableDrivenEditor();
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) { final VerticalLayout verticalLayout = new VerticalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(""); softwareModule.setValue(softwareModuleName); softwareModule.setDescription(softwareModuleName); softwareModule.setId(softwareModuleName + "-label"); horizontalLayout.addComponent(softwareModule); horizontalLayout.setExpandRatio(softwareModule, 1F); verticalLayout.addComponent(horizontalLayout); return verticalLayout; }
public InfoDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); okButton = UIHelper.createButton("ok", null, null, event -> InfoDialog.this.close()); okButton.setId("infoDialog.button.ok"); label.setValue(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }
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);
public OneFieldWindow(RulesPlugin rulesPlugin, FieldMetadata fieldMetadata, MaduraSessionManager maduraSessionManager, final String submitStyle) { main = new VerticalLayout(); setContent(main); setModal(true); main.setMargin(true); main.setSpacing(true); main.setWidth("320px"); MaduraPropertyWrapper maduraPropertyWrapper = maduraSessionManager.getMaduraPropertyWrapper(fieldMetadata); FieldFactory fieldFactory = maduraSessionManager.getFieldFactory(); Field<?> field = fieldFactory.createFieldByPropertyType(maduraPropertyWrapper); field.setReadOnly(true); main.addComponent(field); HorizontalLayout buttons = new HorizontalLayout(); main.addComponent(buttons); Button buttonOK = fieldFactory.createButton("OK", new Button.ClickListener(){ private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { close(); }}); if (submitStyle != null) { buttonOK.setClickShortcut(KeyCode.ENTER ); buttonOK.addStyleName(submitStyle); } buttons.addComponent(buttonOK); buttons.setComponentAlignment(buttonOK, Alignment.BOTTOM_RIGHT); }
protected void initCreateTaskButton() { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setWidth(100, UNITS_PERCENTAGE); form.getFooter().setWidth(100, UNITS_PERCENTAGE); form.getFooter().addComponent(buttonLayout); Button createButton = new Button(i18nManager.getMessage(Messages.BUTTON_CREATE)); buttonLayout.addComponent(createButton); buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT); createButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { handleFormSubmit(); } }); }
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 void setContent() { VerticalLayout panel = new VerticalLayout(); setContent(panel); panel.setMargin(true); panel.setSpacing(true); setWidth("100%"); Label status = new NodeLabel(m_handler); Button startButton = new ActionButton(m_handler, Action.Start); Button stopButton = new ActionButton(m_handler, Action.Stop); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.addComponent(startButton); buttonPanel.addComponent(stopButton); buttonPanel.setSpacing(true); Table propertiesTable = new PropertiesTable(m_handler); propertiesTable.setWidth("100%"); panel.addComponent(status); panel.addComponent(buttonPanel); panel.addComponent(propertiesTable); m_factory.submit(m_statusGetter); }
private Component buildDisclaimer() { final HorizontalLayout fields = new HorizontalLayout(); fields.setSpacing(true); fields.addStyleName("disclaimer"); final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML); disclaimer.setCaption(i18n.getMessage("label.login.disclaimer")); disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE); disclaimer.setId("login-disclaimer"); disclaimer.setWidth("525px"); fields.addComponent(disclaimer); return fields; }
protected void initEventsTable() { eventTable = new Table(); eventTable.setVisible(false); eventTable.setWidth(100, UNITS_PERCENTAGE); eventTable.setHeight(250, UNITS_PIXELS); eventTable.setEditable(false); eventTable.setImmediate(true); eventTable.setSelectable(true); eventTable.setSortDisabled(false); eventTable.addContainerProperty("type", String.class, null, i18nManager.getMessage(Messages.CRYSTALBALL_EVENT_TYPE), null, Table.ALIGN_LEFT); eventTable.addContainerProperty("executed", String.class, null, i18nManager.getMessage(Messages.CRYSTALBALL_EVENT_EXECUTED), null, Table.ALIGN_LEFT); eventLayout.addComponent(eventTable); }
protected void addLinkToProcessDefinition(final VerticalLayout verticalLayout, final String labelText, final boolean isSuspendedProcessDefinition) { HorizontalLayout layout = new HorizontalLayout(); verticalLayout.addComponent(layout); Label processDefinitionLabel = new Label(labelText); processDefinitionLabel.setSizeUndefined(); layout.addComponent(processDefinitionLabel); layout.addComponent(new Label(" ", Label.CONTENT_XHTML)); Button showProcessDefinitionLink = new Button(job.getProcessDefinitionId()); showProcessDefinitionLink.addStyleName(Reindeer.BUTTON_LINK); showProcessDefinitionLink.addListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { if (isSuspendedProcessDefinition) { ExplorerApp.get().getViewManager().showSuspendedProcessDefinitionsPage(job.getProcessDefinitionId()); } else { ExplorerApp.get().getViewManager().showActiveProcessDefinitionsPage(job.getProcessDefinitionId()); } } }); layout.addComponent(showProcessDefinitionLink); }
private Layout createFooter() { HorizontalLayout footer = new HorizontalLayout(); footer.setSpacing(true); footer.setMargin(true); footer.setWidth(100, Unit.PERCENTAGE); footer.addComponent(okayButton); footer.setComponentAlignment(okayButton, Alignment.BOTTOM_RIGHT); return footer; }
public ScriptCodeEditor() { VerticalLayout compositionRoot = new VerticalLayout(); setCompositionRoot(compositionRoot); code = new TextArea(); code.setWidth("100%"); code.setNullRepresentation(""); compositionRoot.addComponent(code); HorizontalLayout hl = new HorizontalLayout(); Button save = new Button(getLocalizedMessage("script.editor.save")); save.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { validateAndSave(); } }); hl.addComponent(save); compositionRoot.addComponent(hl); }