gpt4 book ai didi

com.haulmont.cuba.gui.WindowManager.showOptionDialog()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 00:59:05 29 4
gpt4 key购买 nike

本文整理了Java中com.haulmont.cuba.gui.WindowManager.showOptionDialog()方法的一些代码示例,展示了WindowManager.showOptionDialog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowManager.showOptionDialog()方法的具体详情如下:
包路径:com.haulmont.cuba.gui.WindowManager
类名称:WindowManager
方法名:showOptionDialog

WindowManager.showOptionDialog介绍

[英]Show options dialog with title and message.
Supports line breaks ( \n) for non HTML messageType.
[中]显示带有标题和消息的选项对话框。
支持非HTML messageType的换行符(\n)。

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-gui

/**
 * 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);
}

代码示例来源:origin: com.haulmont.cuba/cuba-gui

/**
 * 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]));
}

代码示例来源:origin: com.haulmont.cuba/cuba-gui

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)
          });
    }
  }
}

代码示例来源:origin: com.haulmont.reports/reports-gui

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});

代码示例来源:origin: com.haulmont.cuba/cuba-gui

@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();
          })
      });
}

代码示例来源:origin: com.haulmont.charts/charts-gui

@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);
  }
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com