/** * 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); }
@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); } }
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 createExpandedAttrsLayout() { BoxLayout expandedAttrsLayout = wizard.componentsFactory.createComponent(HBoxLayout.class); expandedAttrsLayout.setWidth(WIDTH_PERCENT_100); expandedAttrsLayout.add(createFirstRowAttrsLayout()); expandedAttrsLayout.add(createSecondRowAttrsLayout()); return expandedAttrsLayout; }
@Override public Component generateCell(ReportRegion entity) { currentReportRegionGeneratedColumn = entity; BoxLayout mainLayout = wizard.componentsFactory.createComponent(VBoxLayout.class); mainLayout.setWidth(WIDTH_PERCENT_100); mainLayout.add(createFirstTwoRowsLayout()); mainLayout.add(createThirdRowAttrsLayout()); return mainLayout; }
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 createRuntimeDataComponents() { if (rDS != null && categoriesDs != null) { Map<String, Object> params = new HashMap<>(); params.put("runtimeDs", rDS.getId()); params.put("categoriesDs", categoriesDs.getId()); params.put("fieldWidth", themeConstants.get("cuba.gui.EntityInspectorEditor.field.width")); params.put("borderVisible", Boolean.TRUE); RuntimePropertiesFrame runtimePropertiesFrame = (RuntimePropertiesFrame) openFrame(runtimePane, "runtimePropertiesFrame", params); runtimePropertiesFrame.setFrame(this.getFrame()); runtimePropertiesFrame.setMessagesPack("com.haulmont.cuba.gui.app.core.entityinspector"); runtimePropertiesFrame.setCategoryFieldVisible(false); runtimePropertiesFrame.setHeightAuto(); runtimePropertiesFrame.setWidthFull(); runtimePane.add(runtimePropertiesFrame); } }
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; }
protected void initCancelAction() { cancelProcessBtn = componentsFactory.createComponent(Button.class); cancelProcessBtn.setWidth(buttonWidth); cancelProcessAction = new CancelProcessAction(procInstance); cancelProcessAction.addBeforeActionPredicate(beforeCancelProcessPredicate); cancelProcessAction.addAfterActionListener(afterCancelProcessListener); cancelProcessBtn.setAction(cancelProcessAction); actionsBox.add(cancelProcessBtn); }
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; }
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; }
protected void initClaimTaskUI() { if (taskInfoEnabled) initTaskInfoGrid(); noActionsAvailableLbl.setVisible(false); Button claimTaskBtn = componentsFactory.createComponent(Button.class); claimTaskBtn.setWidth(buttonWidth); claimProcTaskAction = new ClaimProcTaskAction(procTask); claimProcTaskAction.addBeforeActionPredicate(beforeClaimTaskPredicate); claimProcTaskAction.addAfterActionListener(afterClaimTaskListener); claimTaskBtn.setAction(claimProcTaskAction); actionsBox.add(claimTaskBtn); }
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 createFilter() { filter = componentsFactory.createComponent(Filter.class); filter.setId("filter"); filter.setFrame(frame); filterBox.add(filter); filter.setUseMaxResults(true); filter.setManualApplyRequired(true); filter.setEditable(true); filter.setDatasource(entitiesDs); ((FilterImplementation) filter).loadFiltersAndApplyDefault(); filter.apply(true); }
protected void createDefaultValueComponent() { defaultValueLayout = (BoxLayout) getComponent("defaultValueLayout"); if (defaultValueLayout != null) { if (defaultValueComponent != null) { defaultValueLayout.remove(defaultValueComponent); } if (condition.getParam() != null) { defaultValueComponent = condition.getParam().createEditComponent(Param.ValueProperty.DEFAULT_VALUE); defaultValueLayout.add(defaultValueComponent); defaultValueComponent.setAlignment(Alignment.MIDDLE_LEFT); if (defaultValueComponent instanceof TextField) { defaultValueComponent.setWidth(theme.get("cuba.gui.conditionFrame.textField.width")); } } } }
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); }
@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); }
protected void initStartProcessUI() { taskInfoGrid.setVisible(false); noActionsAvailableLbl.setVisible(false); startProcessBtn = componentsFactory.createComponent(Button.class); startProcessBtn.setWidth(buttonWidth); startProcessAction = new StartProcessAction(procInstance); startProcessAction.addBeforeActionPredicate(beforeStartProcessPredicate); startProcessAction.addAfterActionListener(afterStartProcessListener); startProcessAction.setProcessVariablesSupplier(startProcessActionProcessVariablesSupplier); startProcessAction.setScreenParametersSupplier(startProcessActionScreenParametersSupplier); startProcessBtn.setAction(startProcessAction); actionsBox.add(startProcessBtn); }
protected void refreshFrameVisible() { if (detailsStepFrame.getFrame().isVisible()) { tipLabel.setValue(getMessage("enterMainParameters")); editAreaVbox.add(editAreaGroupBox); editAreaVbox.remove(regionsStepFrame.getFrame()); editAreaGroupBox.remove(saveStepFrame.getFrame()); editAreaGroupBox.add(detailsStepFrame.getFrame()); } else if (regionsStepFrame.getFrame().isVisible()) { tipLabel.setValue(getMessage("addPropertiesAndTableAreas")); editAreaVbox.remove(editAreaGroupBox); editAreaVbox.add(regionsStepFrame.getFrame()); } else if (saveStepFrame.getFrame().isVisible()) { tipLabel.setValue(getMessage("finishPrepareReport")); editAreaVbox.add(editAreaGroupBox); editAreaVbox.remove(regionsStepFrame.getFrame()); editAreaGroupBox.add(saveStepFrame.getFrame()); editAreaGroupBox.remove(detailsStepFrame.getFrame()); } }
protected void createCommitButtons() { buttonsPanel = uiComponents.create(ButtonsPanel.class); commitButton = uiComponents.create(Button.class); commitButton.setIcon("icons/ok.png"); commitButton.setCaption(messages.getMessage(EntityInspectorEditor.class, "commit")); commitButton.setAction(new CommitAction()); cancelButton = uiComponents.create(Button.class); cancelButton.setIcon("icons/cancel.png"); cancelButton.setCaption(messages.getMessage(EntityInspectorEditor.class, "cancel")); cancelButton.setAction(new CancelAction()); buttonsPanel.add(commitButton); buttonsPanel.add(cancelButton); buttonsBox.add(buttonsPanel); }