@Override public Component createLayout(TabbedLayoutDefinition definition, Map<String, Component> mappings) { TabSheet tabSheetComponent = new TabSheet(); tabSheetComponent.addStyleName(ValoTheme.TABSHEET_FRAMED); tabSheetComponent.setSizeFull(); if (definition.getTabs().size() == 1) { tabSheetComponent.addStyleName("single-tab"); } definition.getTabs().forEach(tabDefinition -> { FormLayout formSection = new FormLayout(); formSection.setMargin(true); formSection.setSizeFull(); tabDefinition.getFields().forEach(field -> { final Component fieldComponent = mappings.get(field.getName()); if (fieldComponent != null) { formSection.addComponent(fieldComponent); // TODO formSection.setComponentHelpDescription(fieldComponent, fieldComponent.getDescription()); } else { log.warn(String.format("Could not retrieve component field named %s from mappings", field.getName())); } }); tabSheetComponent.addTab(formSection, StringUtils.defaultIfBlank(tabDefinition.getLabel(), tabDefinition.getName())); }); return tabSheetComponent; } }
/** * Creates the upper right component of the options grid. * Creation includes the initialization of {@link #m_filePathField}. * * @return the upper right component in the options grid. */ private Component createUpperRightComponent() { HorizontalLayout upperRight = new HorizontalLayout(); upperRight.setSizeFull(); FormLayout fileNameDisplay = new FormLayout(); fileNameDisplay.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); fileNameDisplay.setSizeFull(); m_filePathField = new TextField(); m_filePathField.setWidth("100%"); m_filePathField.setEnabled(true); m_filePathField.setReadOnly(true); fileNameDisplay.addComponent(m_filePathField); fileNameDisplay.setSpacing(true); FormLayout filePathDisplay = new FormLayout(); filePathDisplay.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); filePathDisplay.setSizeFull(); filePathDisplay.addComponent(m_filePathField); filePathDisplay.setSpacing(true); upperRight.addComponent(filePathDisplay); upperRight.setExpandRatio(filePathDisplay, 2f); HorizontalLayout placeHolder = new HorizontalLayout(); placeHolder.setWidth(CmsMessageBundleEditorTypes.OPTION_COLUMN_WIDTH_PX); upperRight.addComponent(placeHolder); return upperRight; }
private Component createComponent(BusinessServiceVertex vertex, GraphContainer container) { final FormLayout rootLayout = new FormLayout(); rootLayout.setSizeFull(); rootLayout.setSpacing(false); rootLayout.setMargin(false);
protected void buildLayout() { mainLayout = new GridLayout(3, 2); mainLayout.setSpacing(true); colorPickerLayout = new ColorPickerLayout(); ColorPickerHelper.setRgbSliderValues(colorPickerLayout); contentLayout = new VerticalLayout(); colorLabelLayout = new HorizontalLayout(); colorLabelLayout.setMargin(false); colorLabelLayout.addComponents(colorLabel, tagColorPreviewBtn); formLayout.addComponent(tagName); formLayout.addComponent(tagDesc); formLayout.setSizeFull(); contentLayout.addComponent(formLayout); contentLayout.addComponent(colorLabelLayout); contentLayout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER); contentLayout.setComponentAlignment(colorLabelLayout, Alignment.MIDDLE_LEFT); contentLayout.setSizeUndefined(); mainLayout.setSizeFull(); mainLayout.addComponent(contentLayout, 0, 0); colorPickerLayout.setVisible(false); mainLayout.addComponent(colorPickerLayout, 1, 0); mainLayout.setComponentAlignment(colorPickerLayout, Alignment.MIDDLE_CENTER); setCompositionRoot(mainLayout); tagName.focus(); }
protected void buildLayout() { mainLayout = new GridLayout(3, 2); mainLayout.setSpacing(true); colorPickerLayout = new ColorPickerLayout(); ColorPickerHelper.setRgbSliderValues(colorPickerLayout); contentLayout = new VerticalLayout(); colorLabelLayout = new HorizontalLayout(); colorLabelLayout.setMargin(false); colorLabelLayout.addComponents(colorLabel, tagColorPreviewBtn); formLayout.addComponent(tagName); formLayout.addComponent(tagDesc); formLayout.setSizeFull(); contentLayout.addComponent(formLayout); contentLayout.addComponent(colorLabelLayout); contentLayout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER); contentLayout.setComponentAlignment(colorLabelLayout, Alignment.MIDDLE_LEFT); contentLayout.setSizeUndefined(); mainLayout.setSizeFull(); mainLayout.addComponent(contentLayout, 0, 0); colorPickerLayout.setVisible(false); mainLayout.addComponent(colorPickerLayout, 1, 0); mainLayout.setComponentAlignment(colorPickerLayout, Alignment.MIDDLE_CENTER); setCompositionRoot(mainLayout); tagName.focus(); }
topLayout.setSizeFull(); topLayout.setWidth("100%");
baseFormLayout.setSizeFull(); baseFormLayout.setMargin(true); baseFormLayout.addComponent(labelField);
baseFormLayout.setSizeFull(); baseFormLayout.setMargin(true); baseFormLayout.addComponent(labelField);
form.setSizeFull(); panelContent.addComponent(form); panelContent.setExpandRatio(form, 1f);