protected void initShortcuts() { Action commitAction = new BaseAction("commitAndClose") .withCaption(messages.getMainMessage("actions.OkClose")) .withShortcut(configuration.getConfig(ClientConfig.class).getCommitShortcut()) .withHandler(e -> commitAndClose() ); addAction(commitAction); }
protected Action initCreateScreenAndComponentAction() { return new BaseAction("create") .withCaption(getMessage("targetScreensTable.create")) .withIcon(icons.get(CubaIcon.CREATE_ACTION)) .withShortcut(clientConfig.getTableInsertShortcut()) .withHandler(e -> screensDs.addItem(metadata.create(ScreenAndComponent.class)) ); }
.withCaption(messages.getMainMessage("actions.OkClose")) .withPrimary(true) .withShortcut(commitShortcut) .withHandler(e -> commitAndClose())); .withCaption(messages.getMainMessage(commitAndCloseButtonExists ? "actions.Save" : "actions.Ok")) .withPrimary(!commitAndCloseButtonExists) .withShortcut(commitAndCloseButtonExists ? null : commitShortcut) .withHandler(e -> { if (!finalCommitAndCloseButtonExists) {
.withShortcut(clientConfig.getCommitShortcut()) .withPrimary(true) .withHandler(event ->
protected void initActions(@SuppressWarnings("unused") InitEvent event) { Window window = getWindow(); Configuration configuration = getBeanLocator().get(Configuration.NAME); Messages messages = getBeanLocator().get(Messages.NAME); Icons icons = getBeanLocator().get(Icons.NAME); String commitShortcut = configuration.getConfig(ClientConfig.class).getCommitShortcut(); Action commitAction = new BaseAction(LOOKUP_SELECT_ACTION_ID) .withCaption(messages.getMainMessage("actions.Select")) .withIcon(icons.get(CubaIcon.LOOKUP_OK)) .withPrimary(true) .withShortcut(commitShortcut) .withHandler(this::select); window.addAction(commitAction); Action closeAction = new BaseAction(LOOKUP_CANCEL_ACTION_ID) .withCaption(messages.getMainMessage("actions.Cancel")) .withIcon(icons.get(CubaIcon.LOOKUP_CANCEL)) .withHandler(this::cancel); window.addAction(closeAction); }
@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(); })); }
.withShortcut(clientConfig.getCommitShortcut()) .withHandler(event -> commitAndClose()
protected void initActions(@SuppressWarnings("unused") InitEvent event) { Window window = getWindow(); Configuration configuration = getBeanLocator().get(Configuration.NAME); Messages messages = getBeanLocator().get(Messages.NAME); Icons icons = getBeanLocator().get(Icons.NAME); String commitShortcut = configuration.getConfig(ClientConfig.class).getCommitShortcut(); Action commitAndCloseAction = new BaseAction(WINDOW_COMMIT_AND_CLOSE) .withCaption(messages.getMainMessage("actions.Ok")) .withIcon(icons.get(CubaIcon.EDITOR_OK)) .withPrimary(true) .withShortcut(commitShortcut) .withHandler(this::commitAndClose); window.addAction(commitAndCloseAction); Action commitAction = new BaseAction(WINDOW_COMMIT) .withCaption(messages.getMainMessage("actions.Save")) .withHandler(this::commit); window.addAction(commitAction); Action closeAction = new BaseAction(WINDOW_CLOSE) .withIcon(icons.get(CubaIcon.EDITOR_CANCEL)) .withCaption(messages.getMainMessage("actions.Cancel")) .withHandler(this::cancel); window.addAction(closeAction); }