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); } }
public void showPreview() { Window parent = (Window) getFrame(); previewBox.setVisible(true); previewBox.setHeight("100%"); previewBox.setWidth("100%"); previewBox.removeAll(); parent.getDialogOptions() .setWidth("1280px") .setResizable(true) .center(); initPreviewContent(previewBox); }
private BoxLayout createBtnsLayout() { BoxLayout btnsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); btnsLayout.setSpacing(true); btnsLayout.setStyleName("on-hover-visible-layout"); return btnsLayout; }
@Override public void setTextMaxResults(boolean textMaxResults) { boolean valueChanged = this.textMaxResults != textMaxResults; this.textMaxResults = textMaxResults; if (maxResultsAddedToLayout && valueChanged) { maxResultsLayout.remove(maxResultsField); maxResultsField = textMaxResults ? maxResultsTextField : maxResultsLookupField; maxResultsLayout.add(maxResultsField); } }
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; }
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")); if (isFixedSize) { layout.setHeight(theme.get("cuba.web.jmx.AttributeEditor.arrayLayout.height")); btnAdd.setIconFromSet(CubaIcon.PLUS_CIRCLE); btnAdd.setDescription(messages.getMessage(getClass(), "editAttribute.array.btnAdd")); layout.add(btnAdd); scrollBoxLayout.setSpacing(true); layout.add(scrollBoxLayout); layout.expand(scrollBoxLayout);
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; }
/** * Method adds a button to the end of the action buttons box. The new button will be displayed below automatically * generated action buttons */ public void addActionButton(Button button) { actionsBox.add(button); }
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); } } }
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); }
private BoxLayout createExpandedAttrsLayout() { BoxLayout expandedAttrsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); expandedAttrsLayout.setWidth(WIDTH_PERCENT_100); expandedAttrsLayout.add(createFirstRowAttrsLayout()); expandedAttrsLayout.add(createSecondRowAttrsLayout()); return expandedAttrsLayout; }
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); }
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 initDefaultValueField() { defaultValueLabel.setVisible(false); defaultValueBox.removeAll(); ReportInputParameter parameter = getItem(); if (canHaveDefaultValue()) { Field<Object> field = parameterFieldCreator.createField(parameter); field.addValueChangeListener(e -> { if (e.getValue() != null) { parameter.setDefaultValue(reportService.convertToString(e.getValue().getClass(), e.getValue())); } else { parameter.setDefaultValue(null); } }); if (parameter.getParameterClass() != null) { field.setValue(reportService.convertFromString(parameter.getParameterClass(), parameter.getDefaultValue())); } field.setRequired(false); defaultValueBox.add(field); defaultValueLabel.setVisible(true); } defaultValueBox.setEnabled(security.isEntityOpPermitted(metadata.getClassNN(ReportInputParameter.class), EntityOp.UPDATE)); }
controlsLayout.setStyleName("filter-control-no-border"); return; } else { BoxLayout paramLayout = uiComponents.create(HBoxLayout.class); paramLayout.setSpacing(true); paramLayout.setMargin(false); labelAndOperationCellContent.addStyleName("param-label-layout"); grid.add(labelAndOperationCellContent, nextColumnStart * 2, row, nextColumnStart * 2, row); if (nextColumnStart != 0) labelAndOperationCellContent.setMargin(false, false, false, true); controlsLayout.setStyleName(getControlsLayoutStyleName());
grid.setStyleName("c-bulk-editor-grid"); contentPane.add(grid); grid.setFrame(frame); boxLayout.setFrame(getFrame()); boxLayout.setSpacing(true); boxLayout.add(editField); clearButton.setDescription(getMessage("bulk.clearAttribute")); boxLayout.add(clearButton);
public void setCategoryFieldVisible(boolean visible) { categoryFieldBox.setVisible(visible); }