/** * Creates either Remove or Exclude action depending on property type */ protected RemoveAction createRemoveAction(MetaProperty metaProperty, Table table) { RemoveAction result; switch (metaProperty.getType()) { case COMPOSITION: result = new com.haulmont.cuba.gui.components.actions.RemoveAction(table); break; case ASSOCIATION: result = new com.haulmont.cuba.gui.components.actions.ExcludeAction(table); result.setShortcut(configuration.getConfig(ClientConfig.class).getTableRemoveShortcut()); break; default: throw new IllegalArgumentException("property must contain an entity"); } result.setAutocommit(false); return result; }
protected void initScreens() { screenTable.addAction(new RemoveAction(screenTable, false)); List<WindowInfo> windowInfoCollection = new ArrayList<>(windowConfig.getWindows());
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)); }
@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); }
@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(); }
RemoveAction removeAction = new RemoveAction(uiPermissionsTable, false); removeAction.setAfterRemoveHandler(removedItems -> { if (!removedItems.isEmpty()) {
@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; }); }
EditSubstitutedAction editSubstitutedAction = new EditSubstitutedAction(); substTable.addAction(editSubstitutedAction); RemoveAction removeSubstitutedAction = new RemoveAction(substTable, false); substTable.addAction(removeSubstitutedAction);