/** * Show options dialog with title and message. <br> * Message supports line breaks ({@code \n}). * * @param title dialog title * @param message text * @param messageType defines how to display the dialog. * Don't forget to escape data from the database in case of {@code *_HTML} types! * @param actions array of actions that represent options. For standard options consider use of * {@link DialogAction} instances. * * @deprecated Use {@link Dialogs} bean instead. */ @Deprecated default void showOptionDialog(String title, String message, Frame.MessageType messageType, Action[] actions) { getWindowManager().showOptionDialog(title, message, messageType, actions); }
/** * Show options dialog with title and message. <br> * Message supports line breaks ({@code \n}). * * @param title dialog title * @param message text * @param messageType defines how to display the dialog. * Don't forget to escape data from the database in case of {@code *_HTML} types! * @param actions list of actions that represent options. For standard options consider use of * {@link DialogAction} instances. * * @deprecated Use {@link Dialogs} bean instead. */ @Deprecated default void showOptionDialog(String title, String message, Frame.MessageType messageType, List<Action> actions) { getWindowManager().showOptionDialog(title, message, messageType, actions.toArray(new Action[0])); }
protected void removeAppliedFilter() { if (!appliedFilters.isEmpty()) { if (appliedFilters.size() == 1) { AppliedFilterHolder holder = appliedFilters.removeLast(); appliedFiltersLayout.remove(holder.layout); adapter.unpinAllQuery(); this.layout.remove(appliedFiltersLayout); } else { windowManager.showOptionDialog( messages.getMainMessage("removeApplied.title"), messages.getMainMessage("removeApplied.message"), MessageType.WARNING, new Action[]{ new DialogAction(Type.YES).withHandler(event -> { for (AppliedFilterHolder holder : appliedFilters) { appliedFiltersLayout.remove(holder.layout); FilterDelegateImpl.this.layout.remove(appliedFiltersLayout); } appliedFilters.clear(); adapter.unpinAllQuery(); }), new DialogAction(Type.NO, Status.PRIMARY) }); } } }
wm.showOptionDialog(messages.getMessage(ReportGuiManager.class, "notifications.confirmPrintSelectedheader"), messages.getMessage(ReportGuiManager.class, "notifications.confirmPrintSelected"), Frame.MessageType.CONFIRMATION, wm.showOptionDialog(messages.getMessage(ListPrintFormAction.class, "notifications.confirmPrintAllheader"), messages.getMessage(ListPrintFormAction.class, "notifications.confirmPrintAll"), Frame.MessageType.CONFIRMATION, new Action[]{yesAction, cancelAction});
@Override public void actionPerform(Component component) { if (filterEntity == adHocFilter) return; windowManager.showOptionDialog( getMainMessage("filter.removeDialogTitle"), getMainMessage("filter.removeDialogMessage"), MessageType.CONFIRMATION, new Action[]{ new DialogAction(Type.YES).withHandler(event -> { removeFilterEntity(); settingsBtn.focus(); }), new DialogAction(Type.NO, Status.PRIMARY).withHandler(event -> { settingsBtn.focus(); }) }); }
@Override public void actionPerform(Component component) { if (beforeActionPerformedHandler != null) { if (!beforeActionPerformedHandler.beforeActionPerformed()) return; } Messages messages = AppBeans.get(Messages.NAME); if (target.getSelected().isEmpty() || target.getDatasource().size() <= 1) { showPivotTable(ALL_ROWS); } else { Action[] actions = new Action[]{ new BaseAction("actions.showPivotAction.SELECTED_ROWS") .withCaption(messages.getMainMessage("actions.showPivotAction.SELECTED_ROWS")) .withHandler(event -> showPivotTable(SELECTED_ROWS)), new BaseAction("actions.showPivotAction.ALL_ROWS") .withCaption(messages.getMainMessage("actions.showPivotAction.ALL_ROWS")) .withHandler(event -> showPivotTable(ALL_ROWS)), new DialogAction(DialogAction.Type.CANCEL) }; WindowManager wm = target.getFrame().getWindowManager(); wm.showOptionDialog( messages.getMainMessage("actions.showPivotAction.dialogTitle"), messages.getMainMessage("actions.showPivotAction.dialogMessage"), Frame.MessageType.CONFIRMATION, actions); } }