protected Action loadStubAction(Element element, String id, boolean shouldTrackSelection) { Action targetAction; if (shouldTrackSelection) { targetAction = new ItemTrackingAction(id); } else { targetAction = new BaseAction(id); } initAction(element, targetAction); return targetAction; }
protected void initMoveButtons() { Action moveUpAction = new ItemTrackingAction("moveUp") .withCaption("") .withHandler(event -> { ((Button) getComponentNN("moveUp")).setAction(moveUpAction); Action moveDownAction = new ItemTrackingAction("moveDown") .withCaption("") .withHandler(event -> {
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); }
super.init(params); Action copyRoles = new ItemTrackingAction("copy") .withCaption(getMessage("actions.Copy")) .withHandler(event -> { Action assignToUsersAction = new ItemTrackingAction(rolesTable, "assignToUsers") .withCaption(getMessage("assignToUsers")) .withHandler(event -> {
super.init(params); filesTable.addAction(new ItemTrackingAction("download") .withCaption(getMessage("download")) .withHandler(event -> {
Action restoreAction = new ItemTrackingAction("restore") .withCaption(getMessage("entityRestore.restore")) .withPrimary(true)
constraintsTable.addAction(constraintCreateAction); Action activateAction = new ItemTrackingAction("activate") .withHandler(event -> { Constraint constraint = constraintsTable.getSingleSelected(); BaseAction moveToGroupAction = new ItemTrackingAction("moveToGroup") .withCaption(getMessage("actions.constraint.moveToGroup")) .withIcon("icons/move.png")
metadata.getClassNN(Report.class), EntityOp.CREATE); Action copyAction = new ItemTrackingAction("copy") .withCaption(getMessage("copy")) .withHandler(event -> { copyReport.setAction(copyAction); runReport.setAction(new ItemTrackingAction("runReport") .withCaption(getMessage("runReport")) .withHandler(event -> { importReport.setAction(importAction); Action exportAction = new ItemTrackingAction("export") .withHandler(event -> { Set<Report> reports = reportsTable.getSelected();
@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(); })); }
Action inspectAction = new ItemTrackingAction("inspect") .withCaption(getMessage("action.inspect")) .withHandler(event -> {