protected Action createLookupAction() { return new BaseAction("") .withIcon(icons.get(CubaIcon.PICKERFIELD_LOOKUP)) .withHandler(e -> openLookup(null)); }
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)) ); }
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); }
protected void logoutPrompt() { Dialogs dialogs = ((AppUI) getUI()).getDialogs(); dialogs.createOptionDialog(MessageType.WARNING) .withCaption(messages.getMainMessage("exceptionDialog.logoutCaption")) .withMessage(messages.getMainMessage("exceptionDialog.logoutMessage")) .withActions( new BaseAction("close") .withCaption(messages.getMainMessage("closeApplication")) .withIcon("icons/ok.png") .withHandler(event -> forceLogout()), new DialogAction(Type.CANCEL, Status.PRIMARY) ) .show(); }
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); }
.withIcon("icons/plus-btn.png") .withHandler(event -> { JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor(
.withIcon("icons/plus-btn.png") .withHandler(event -> { JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor(
/** * Check modifications and close all screens in all main windows excluding root screens. * * @return operation result */ public OperationResult checkModificationsAndCloseAll() { if (hasUnsavedChanges()) { UnknownOperationResult result = new UnknownOperationResult(); ui.getDialogs().createOptionDialog() .withCaption(messages.getMainMessage("closeUnsaved.caption")) .withMessage(messages.getMainMessage("discardChangesOnClose")) .withActions( new BaseAction("closeApplication") .withCaption(messages.getMainMessage("closeApplication")) .withIcon(icons.get(CubaIcon.DIALOG_OK)) .withHandler(event -> { closeWindowsInternal(); result.success(); }), new DialogAction(DialogAction.Type.CANCEL, Action.Status.PRIMARY) .withHandler(event -> result.fail()) ) .show(); return result; } else { closeWindowsInternal(); return OperationResult.success(); } }
.withIcon("icons/plus-btn.png") .withHandler(event -> { JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor(
}), new BaseAction("discard") .withIcon(icons.get(CubaIcon.DIALOG_CANCEL)) .withCaption(messages.getMainMessage("closeUnsaved.discard")) .withHandler(e -> {
new BaseAction("closeApplication") .withCaption(messages.getMainMessage("closeApplication")) .withIcon(icons.get(CubaIcon.DIALOG_OK)) .withHandler(event -> { performStandardLogout(ui);