public void build() { for (Map.Entry<String, List<String>> entry : components.entrySet()) { String componentName = entry.getKey(); Component component = getControlsLayoutComponent(componentName, entry.getValue()); if (component == null) { //in case of disabled FTS add-on, the missing fts_switch component is not an error if (!isFtsModeEnabled() && "fts_switch".equals(componentName)) { continue; } log.warn("Filter controls layout component {} not supported", componentName); continue; } controlsLayout.add(component); if (component == controlsLayoutGap) { controlsLayout.expand(component); } } }
private BoxLayout createFirstTwoRowsLayout() { BoxLayout firstTwoRowsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); BoxLayout expandedAttrsLayout = createExpandedAttrsLayout(); firstTwoRowsLayout.setWidth(WIDTH_PERCENT_100); firstTwoRowsLayout.add(expandedAttrsLayout); firstTwoRowsLayout.add(createBtnsLayout()); firstTwoRowsLayout.expand(expandedAttrsLayout); return firstTwoRowsLayout; }
public void createParamEditLayout() { if (paramEditComponentLayout == null){ paramEditComponentLayout = uiComponents.create(HBoxLayout.class); paramEditComponentLayout.setSpacing(true); paramEditComponentLayout.setWidthFull(); } paramEditComponent = condition.getParam().createEditComponent(Param.ValueProperty.VALUE); paramEditComponent.addStyleName("param-field"); if (paramEditComponent instanceof Field) { ((Field) paramEditComponent).setRequired(condition.getRequired()); } paramEditComponentLayout.add(paramEditComponent); removeButton = uiComponents.create(LinkButton.class); removeButton.setStyleName("condition-remove-btn"); removeButton.setIcon("icons/item-remove.png"); removeButton.setAlignment(Alignment.MIDDLE_LEFT); removeButton.setVisible(removeButtonVisible); removeButton.setAction(removeButtonAction); paramEditComponentLayout.add(removeButton); if (paramEditComponentExpandRequired(condition)) { paramEditComponentLayout.expand(paramEditComponent); } else { HBoxLayout spring = uiComponents.create(HBoxLayout.class); paramEditComponentLayout.add(spring); paramEditComponentLayout.expand(spring); } }
protected void addRow(Object value, ComponentContainer parent, boolean isReadOnly) { BoxLayout row = componentsFactory.createComponent(HBoxLayout.class); row.setSpacing(true); row.setWidthFull(); TextField valueField = componentsFactory.createComponent(TextField.class); valueField.setValue(value); valueField.setEditable(!isReadOnly); row.add(valueField); row.expand(valueField); Button btnRemove = componentsFactory.createComponent(Button.class); btnRemove.setIconFromSet(CubaIcon.TIMES); btnRemove.setDescription(messages.getMessage(getClass(), "editAttribute.array.btnRemove")); Action removeRowAction = new BaseAction("removeRow") .withCaption("") .withHandler(actionPerformedEvent -> parent.remove(row) ); removeRowAction.setEnabled(!isReadOnly); btnRemove.setAction(removeRowAction); row.add(btnRemove); parent.add(row); }
vbox.expand(table); vbox.setMargin(true);
tablePanel.expand(entitiesTable, "100%", "100%");
@Override public void init(Map<String, Object> params) { super.init(params); ThemeConstants theme = themeConstantsManager.getConstants(); getDialogOptions() .setWidth(theme.get("cuba.gui.commonLookup.width")) .setHeight(theme.get("cuba.gui.commonLookup.height")) .setResizable(true); setCaption(messageTools.getEntityCaption(metaClass)); initView(); initDatasource(); initTable(); initFilter(); mainPane.add(filter); mainPane.add(entitiesTable); mainPane.expand(entitiesTable); setLookupComponent(entitiesTable); }
layout.expand(scrollBoxLayout);
controlsLayout.expand(controlsLayoutGap);
filterHelper.setInternalDebugId(controlsLayoutGap, "controlsLayoutGap"); controlsLayout.add(controlsLayoutGap); controlsLayout.expand(controlsLayoutGap);