protected void initRoles() { rolesTable.addAction(new ExcludeAction(rolesTable, false, true) { @Override public boolean isEnabled() { return super.isEnabled() && isUpdatePermitted(); } }); addRoleBtn.setAction(new AbstractAction("actions.Add") { @Override public void actionPerform(Component component) { if (lookupRolesDs.getItem() != null && !rolesDs.containsItem(lookupRolesDs.getItem().getId())) { rolesDs.addItem(lookupRolesDs.getItem()); } } @Override public boolean isEnabled() { return super.isEnabled() && isUpdatePermitted(); } }); }
protected void initValuesFormats() { CreateAction formatCreateAction = CreateAction.create(formatsTable, OpenType.DIALOG); formatCreateAction.setInitialValuesSupplier(() -> ParamsMap.of("report", getItem()) ); formatsTable.addAction(formatCreateAction); formatsTable.addAction(new RemoveAction(formatsTable, false)); formatsTable.addAction(new EditAction(formatsTable, OpenType.DIALOG)); }
protected void initAttributesTab() { if (attributesTabInitialized) { return; } Table attributesTable = (Table) getComponentNN("attributesTable"); attributeCreateAction = new GroupPropertyCreateAction(attributesTable); attributesTable.addAction(attributeCreateAction); attributesTabInitialized = true; attributesDs.refresh(); }
@Override public void init(Map<String, Object> params) { super.init(params); categoryAttrsTable.addAction(new CategoryAttributeCreateAction()); categoryAttrsTable.addAction(new CategoryAttributeEditAction()); categoryAttrsTable.addAction(new RemoveAction(categoryAttrsTable, false)); categoryAttrsTable.addAction(new RefreshAction(categoryAttrsTable)); categoryAttrsDs.addStateChangeListener(e -> { if (e.getState() != Datasource.State.VALID) { return; } initDataTypeColumn(); initDefaultValueColumn(); }); initMoveButtons(); }
protected void initAggregationTable() { Supplier<Map<String, Object>> paramsSupplier = () -> ParamsMap.of("existingItems", aggregationsDs.getItems()); CreateAction createAction = CreateAction.create(aggregationsTable); createAction.setWindowParamsSupplier(paramsSupplier); aggregationsTable.addAction(createAction); EditAction editAction = EditAction.create(aggregationsTable); editAction.setWindowParamsSupplier(paramsSupplier); aggregationsTable.addAction(editAction); aggregationsTable.addAction(RemoveAction.create(aggregationsTable)); aggregationsDs.addCollectionChangeListener(e -> { if (e.getOperation() == CollectionDatasource.Operation.REMOVE) { defaultAggregation.setOptionsDatasource(aggregationsDs); } }); }
@Override public void init(Map<String, Object> params) { if (WindowParams.MULTI_SELECT.getBool(getContext())) { usersTable.setMultiSelect(true); } RemoveAction removeAction = new UserRemoveAction(usersTable, userManagementService); usersTable.addAction(removeAction); } }
@Override public void init(Map<String, Object> params) { super.init(params); createAction.setOpenType(WindowManager.OpenType.DIALOG); editAction.setOpenType(WindowManager.OpenType.DIALOG); reportGroupsTable.addAction(new RemoveReportGroupAction(reportGroupsTable)); }
@Override public void init(Map<String, Object> params) { getDialogOptions().setWidth(themeConstants.get("cuba.gui.AttributeEditor.width")); fieldWidth = themeConstants.get("cuba.gui.AttributeEditor.field.width"); initLocalizedFrame(); initFieldGroup(); Action createAction = initCreateScreenAndComponentAction(); targetScreensTable.addAction(createAction); Action removeAction = new RemoveAction(targetScreensTable); removeAction.setCaption(getMessage("targetScreensTable.remove")); targetScreensTable.addAction(removeAction); }
protected void initUsersTableActions() { userCreateAction = new GroupPropertyCreateAction(usersTable); userCreateAction.setAfterCommitHandler(entity -> usersTable.getDatasource().refresh() ); usersTable.addAction(userCreateAction); usersTable.addAction(new UserRemoveAction(usersTable, userManagementService)); Action moveToGroupAction = new ItemTrackingAction("moveToGroup") .withIcon("icons/move.png") .withCaption(getMessage("moveToGroup")) .withHandler(event -> { Set<User> selected = usersTable.getSelected(); if (!selected.isEmpty()) { moveUsersToGroup(selected); } }); moveToGroupAction.setEnabled(security.isEntityOpPermitted(User.class, EntityOp.UPDATE)); usersTable.addAction(moveToGroupAction); }
@Override public void init(Map<String, Object> params) { super.init(params); procDefinitionTable.addAction(new ProcDefinitionRemoveAction(procDefinitionTable)); deployUpload.addFileUploadSucceedListener(new UploadSucceedListener()); deployUpload.addFileUploadErrorListener(new UploadErrorListener()); }
@Override public void init(Map<String, Object> params) { LinkColumnHelper.initColumn(historyTable, "caption", entity -> { close("windowClose"); openUrl(entity); }); historyTable.addAction(new ShowLinkAction(historyTable.getDatasource(), entity -> entity != null ? ((ScreenHistoryEntity) entity).getUrl() : "") ); }
@Override public void init(Map<String, Object> params) { categoryTable.addAction(new CreateAction()); categoryTable.addAction(new EditAction()); categoryTable.addAction(new RemoveAction(categoryTable)); categoryTable.addAction(new BaseAction("applyChanges") .withCaption(getMessage("categoryTable.applyChanges")) .withHandler(actionPerformedEvent -> { dynamicAttributesCacheService.loadCache(); clientCacheManager.refreshCached(DynamicAttributesCacheStrategy.NAME); permissionConfig.clearConfigCache(); showNotification(getMessage("notification.changesApplied")); })); categoryTable.removeGeneratedColumn("entityType"); categoryTable.addGeneratedColumn("entityType", entity -> { Label dataTypeLabel = componentsFactory.createComponent(Label.class); MetaClass meta = metadata.getSession().getClassNN(entity.getEntityType()); dataTypeLabel.setValue(messageTools.getEntityCaption(meta)); return dataTypeLabel; }); }
@Override public void init(Map<String, Object> params) { executionsTable.addAction(new RefreshAction(executionsTable)); int maxResults = persistenceManager.getFetchUI(executionsDs.getMetaClass().getName()); executionsDs.setMaxResults(maxResults); setCaption(formatMessage("executionBrowseCaption", task.name())); } }
@Override public void init(Map<String, Object> params) { super.init(params); windowConfig = AppBeans.get(WindowConfig.class); procTasksTable.addGeneratedColumn("assigned", entity -> { CheckBox checkBox = componentsFactory.createComponent(CheckBox.class); checkBox.setValue(entity.getProcActor() != null); return checkBox; }); Action openEntityEditorAction = new OpenEntityEditorAction(); procTasksTable.addAction(openEntityEditorAction); openEntityEditorBtn.setAction(openEntityEditorAction); procTasksTable.setItemClickAction(openEntityEditorAction); }
rolesTable.addAction(addRoleAction); EditRoleAction editRoleAction = new EditRoleAction(); rolesTable.addAction(editRoleAction); boolean isUserUpdatePermitted = security.isEntityOpPermitted(User.class, EntityOp.UPDATE); removeRoleAction.setEnabled(isUserRoleDeletePermitted && isUserUpdatePermitted); rolesTable.addAction(removeRoleAction); substTable.addAction(addSubstitutedAction); EditSubstitutedAction editSubstitutedAction = new EditSubstitutedAction(); substTable.addAction(editSubstitutedAction); RemoveAction removeSubstitutedAction = new RemoveAction(substTable, false); substTable.addAction(removeSubstitutedAction);
protected void initProcAttachmentsTable() { procAttachmentsTable.addGeneratedColumn("type", entity -> { LookupField<ProcAttachmentType> lookupField = componentsFactory.createComponent(LookupField.class); lookupField.setOptionsDatasource(procAttachmentTypesDs); lookupField.setValue(entity.getType()); lookupField.addValueChangeListener(e -> { entity.setType((ProcAttachmentType) e.getValue()); }); return lookupField; }); FileDownloadHelper.initGeneratedColumn(procAttachmentsTable, "file"); //replace standard edit action because we want to pass parent datasource to attachment editor procAttachmentsTable.addAction(new EditAction(procAttachmentsTable) { @Override public void actionPerform(Component component) { final Window.Editor editor = openEditor("bpm$ProcAttachment.edit", procAttachmentsDs.getItem(), WindowManager.OpenType.DIALOG, procAttachmentsDs); editor.addCloseListener(actionId -> { procAttachmentsDs.updateItem((ProcAttachment) editor.getItem()); }); } }); }
protected Table createTable(String dataSetName, GroupDatasource dataSource) { Table table = componentsFactory.createComponent(GroupTable.class); table.setId(dataSetName + "Table"); createColumns(dataSource, table); table.setDatasource(dataSource); table.setWidth("100%"); table.setMultiSelect(true); ExcelAction excelAction = ExcelAction.create(table); excelAction.setFileName(dataSetName); Button excelButton = componentsFactory.createComponent(Button.class); excelButton.setAction(excelAction); ButtonsPanel buttonsPanel = componentsFactory.createComponent(ButtonsPanel.class); table.setButtonsPanel(buttonsPanel); table.addAction(excelAction); buttonsPanel.add(excelButton); return table; }
super.init(params); filesTable.addAction(new ItemTrackingAction("download") .withCaption(getMessage("download")) .withHandler(event -> {
procModelsTable.addAction(removeAction); removeBtn.setAction(removeAction);
@Override public void init(Map<String, Object> params) { super.init(params); List<Report> reports = reportsParameter; if (reports == null) { reports = reportGuiManager.getAvailableReports(screenParameter, userSessionSource.getUserSession().getUser(), null); } if (reportsParameter != null) { gridFilter.setVisible(false); } for (Report report : reports) { reportDs.includeItem(report); } Action runAction = new ItemTrackingAction(RUN_ACTION_ID) .withCaption(getMessage("runReport")) .withHandler(e -> { Report report = reportsTable.getSingleSelected(); if (report != null) { report = getDsContext().getDataSupplier().reload(report, ReportService.MAIN_VIEW_NAME); reportGuiManager.runReport(report, ReportRun.this); } }); reportsTable.addAction(runAction); reportsTable.setItemClickAction(runAction); addAction(new BaseAction("applyFilter") .withShortcut(clientConfig.getFilterApplyShortcut()) .withHandler(e -> { filterReports(); })); }