private BoxLayout createBtnsLayout() { BoxLayout btnsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); btnsLayout.setSpacing(true); btnsLayout.setStyleName("on-hover-visible-layout"); return btnsLayout; }
protected void addValueToLayout(final Object value, String str) { BoxLayout itemLayout = uiComponents.create(HBoxLayout.class); itemLayout.setId("itemLayout"); itemLayout.setSpacing(true); Label<String> itemLab = uiComponents.create(Label.NAME); if (options instanceof MapOptions) { //noinspection unchecked Map<String, Object> optionsMap = ((MapOptions) options).getItemsCollection(); str = optionsMap.entrySet() .stream() .filter(entry -> Objects.equals(entry.getValue(), value)) .findFirst() .get().getKey(); } itemLab.setValue(str); itemLayout.add(itemLab); itemLab.setAlignment(Alignment.MIDDLE_LEFT); LinkButton delItemBtn = uiComponents.create(LinkButton.class); delItemBtn.setIcon("icons/item-remove.png"); delItemBtn.addClickListener(e -> { valuesMap.remove(value); valuesLayout.remove(itemLayout); }); itemLayout.add(delItemBtn); if (BooleanUtils.isFalse(editable)) { delItemBtn.setEnabled(false); } valuesLayout.add(itemLayout); valuesMap.put(value, str); }
protected void addAppliedFilter() { if (lastAppliedFilter == null) return; if (!appliedFilters.isEmpty() && appliedFilters.getLast().filter.equals(lastAppliedFilter)) return; this.layout.add(appliedFiltersLayout, CONDITIONS_LOCATION_TOP.equals(conditionsLocation) ? 0 : 1); BoxLayout layout = uiComponents.create(HBoxLayout.class); layout.setSpacing(true); if (!appliedFilters.isEmpty()) { AppliedFilterHolder holder = appliedFilters.getLast(); holder.layout.remove(holder.button); } Label<String> label = uiComponents.create(Label.NAME); label.setValue(lastAppliedFilter.getText()); layout.add(label); label.setAlignment(Alignment.MIDDLE_LEFT); LinkButton button = uiComponents.create(LinkButton.class); button.setIcon("icons/item-remove.png"); button.addClickListener(e -> removeAppliedFilter()); layout.add(button); addAppliedFilterLayoutHook(layout); appliedFiltersLayout.add(layout); appliedFilters.add(new AppliedFilterHolder(lastAppliedFilter, layout, button)); }
private BoxLayout createFirstRowAttrsLayout() { BoxLayout firstRowAttrsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); firstRowAttrsLayout.setSpacing(true); Label regionLbl = wizard.componentsFactory.createComponent(Label.class); regionLbl.setStyleName(BOLD_LABEL_STYLE); regionLbl.setValue(wizard.getMessage("region")); Label regionValueLbl = wizard.componentsFactory.createComponent(Label.class); regionValueLbl.setValue(currentReportRegionGeneratedColumn.getName()); regionValueLbl.setWidth(WIDTH_PERCENT_100); firstRowAttrsLayout.add(regionLbl); firstRowAttrsLayout.add(regionValueLbl); return firstRowAttrsLayout; }
private BoxLayout createSecondRowAttrsLayout() { BoxLayout secondRowAttrsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); secondRowAttrsLayout.setSpacing(true); Label entityLbl = wizard.componentsFactory.createComponent(Label.class); entityLbl.setStyleName(BOLD_LABEL_STYLE); entityLbl.setValue(wizard.getMessage("entity")); Label entityValueLbl = wizard.componentsFactory.createComponent(Label.class); entityValueLbl.setValue(wizard.messageTools.getEntityCaption(currentReportRegionGeneratedColumn.getRegionPropertiesRootNode().getWrappedMetaClass())); entityValueLbl.setWidth(WIDTH_PERCENT_100); secondRowAttrsLayout.add(entityLbl); secondRowAttrsLayout.add(entityValueLbl); return secondRowAttrsLayout; }
boxLayout.setSpacing(true);
private BoxLayout createThirdRowAttrsLayout() { BoxLayout thirdRowAttrsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); thirdRowAttrsLayout.setSpacing(true); Label entityLbl = wizard.componentsFactory.createComponent(Label.class); entityLbl.setStyleName(BOLD_LABEL_STYLE); entityLbl.setValue(wizard.getMessage("attributes")); Button editBtn = wizard.componentsFactory.createComponent(Button.class); editBtn.setCaption(generateAttrsBtnCaption()); editBtn.setStyleName("link"); editBtn.setWidth(WIDTH_PERCENT_100); editBtn.setAction(editRegionAction); thirdRowAttrsLayout.add(entityLbl); thirdRowAttrsLayout.add(editBtn); return thirdRowAttrsLayout; }
public ParamEditor(AbstractCondition condition, boolean removeButtonVisible, boolean operationEditable) { this.condition = condition; this.removeButtonVisible = removeButtonVisible; uiComponents = AppBeans.get(UiComponents.class); labelAndOperationLayout = uiComponents.create(HBoxLayout.class); labelAndOperationLayout.setSpacing(true); labelAndOperationLayout.setAlignment(Alignment.MIDDLE_RIGHT); captionLbl = uiComponents.create(Label.NAME); captionLbl.setAlignment(Alignment.MIDDLE_RIGHT); captionLbl.setValue(condition.getLocCaption()); labelAndOperationLayout.add(captionLbl); operationEditor = condition.createOperationEditor().getComponent(); operationEditor.setEnabled(operationEditable); labelAndOperationLayout.add(operationEditor); createParamEditLayout(); condition.addListener(this); }
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); }
protected void createMaxResultsLayout() { maxResultsLayout = uiComponents.create(HBoxLayout.class); maxResultsLayout.setStyleName("c-maxresults"); maxResultsLayout.setSpacing(true); Label<String> maxResultsLabel = uiComponents.create(Label.NAME); maxResultsLabel.setStyleName("c-maxresults-label"); maxResultsLabel.setValue(messages.getMainMessage("filter.maxResults.label1")); maxResultsLabel.setAlignment(Alignment.MIDDLE_RIGHT); maxResultsLayout.add(maxResultsLabel); maxResultsTextField = uiComponents.create(TextField.TYPE_INTEGER); maxResultsTextField.setStyleName("c-maxresults-input"); maxResultsTextField.setMaxLength(4); maxResultsTextField.setWidth(theme.get("cuba.gui.Filter.maxResults.width")); maxResultsLookupField = maxResultsFieldHelper.createMaxResultsLookupField(); maxResultsLookupField.setStyleName("c-maxresults-select"); maxResultsField = textMaxResults ? maxResultsTextField : maxResultsLookupField; maxResultsField.addValueChangeListener(integerValueChangeEvent -> maxResultValueChanged = true); maxResultsLayout.add(maxResultsField); }
BoxLayout vl = uiComponents.create(VBoxLayout.class); vl.setMargin(false, false, true, false); vl.setSpacing(true); vl.setStyleName("c-mbeans-operation-container");
protected void initArrayLayout(Object value, boolean isFixedSize, boolean isReadOnly) { layout.setSpacing(true); ThemeConstants theme = App.getInstance().getThemeConstants(); layout.setWidth(theme.get("cuba.web.jmx.AttributeEditor.arrayLayout.width"));
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); } }
} else { BoxLayout paramLayout = uiComponents.create(HBoxLayout.class); paramLayout.setSpacing(true); paramLayout.setMargin(false);
protected void createControlsLayoutForFts() { controlsLayout = uiComponents.create(HBoxLayout.class); controlsLayout.setSpacing(true); controlsLayout.setWidthFull();
protected void createControlsLayoutForGeneric() { controlsLayout = uiComponents.create(HBoxLayout.class); controlsLayout.setSpacing(true); controlsLayout.setWidthFull(); filterHelper.setInternalDebugId(controlsLayout, "controlsLayout");