gpt4 book ai didi

com.haulmont.cuba.gui.WindowManager类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 01:23:05 25 4
gpt4 key购买 nike

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

WindowManager介绍

[英]Legacy window manager.
[中]遗留窗口管理器。

代码示例

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

/**
 * Open a simple screen.
 *
 * @param windowAlias screen ID as defined in {@code screens.xml}
 * @param openType    how to open the screen
 * @return created window
 *
 * @deprecated Use {@link Screens} bean instead.
 */
@Deprecated
default AbstractWindow openWindow(String windowAlias, WindowManager.OpenType openType) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
  return (AbstractWindow) getWindowManager().openWindow(windowInfo, openType);
}

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

@Override
  protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) {
    windowManager.showNotification(message, Frame.NotificationType.ERROR);
  }
}

代码示例来源: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-web

@Override
  public void handleAction(com.vaadin.event.Action action, Object sender, Object target) {
    if (initialized) {
      if (saveSettingsAction == action) {
        Screen screen = getFrameOwner();
        UiControllerUtils.saveSettings(screen);
      } else if (restoreToDefaultsAction == action) {
        Screen screen = getFrameOwner();
        UiControllerUtils.deleteSettings(screen);
      } else if (analyzeAction == action) {
        LayoutAnalyzer analyzer = new LayoutAnalyzer();
        List<LayoutTip> tipsList = analyzer.analyze(WebDialogWindow.this);
        if (tipsList.isEmpty()) {
          getWindowManager().showNotification("No layout problems found", Frame.NotificationType.HUMANIZED);
        } else {
          WindowConfig windowConfig = beanLocator.get(WindowConfig.NAME);
          WindowInfo windowInfo = windowConfig.getWindowInfo("layoutAnalyzer");
          getWindowManager().openWindow(windowInfo, WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList));
        }
      }
    }
  }
}

代码示例来源: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});
} else {
  wm.showNotification(messages.getMessage(ReportGuiManager.class, "notifications.noSelectedEntity"),
      Frame.NotificationType.HUMANIZED);

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

wm.showNotification(messages.getMainMessage("OpenAction.objectIsDeleted"),
      Frame.NotificationType.HUMANIZED);
  return;
AbstractEditor editor = (AbstractEditor) wm.openEditor(
    windowConfig.getWindowInfo(windowAlias),
    entity,

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

@Override
  public void onApplicationEvent(AppLoggedInEvent event) {
    App app = event.getApp();
    Connection connection = app.getConnection();

    if (connection.isAuthenticated()
        && !isLoggedInWithExternalAuth(connection.getSessionNN())) {
      User user = connection.getSessionNN().getUser();
      // Change password on logon
      if (Boolean.TRUE.equals(user.getChangePasswordAtNextLogon())) {
        WindowManager wm = app.getWindowManager();
        for (Window window : wm.getOpenWindows()) {
          window.setEnabled(false);
        }

        WindowInfo changePasswordDialog = windowConfig.getWindowInfo("sec$User.changePassword");

        Window changePasswordWindow = wm.openWindow(changePasswordDialog,
            WindowManager.OpenType.DIALOG.closeable(false),
            ParamsMap.of("cancelEnabled", Boolean.FALSE));

        changePasswordWindow.addCloseListener(actionId -> {
          for (Window window : wm.getOpenWindows()) {
            window.setEnabled(true);
          }
        });
      }
    }
  }
}

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

WindowInfo windowInfo = AppBeans.get(WindowConfig.class).getWindowInfo("report$Report.run");
wm.openLookup(windowInfo, items -> {
  if (CollectionUtils.isNotEmpty(items)) {
    Report report = (Report) items.iterator().next();
wm.showNotification(
    messages.getMessage(ReportGuiManager.class, "report.notFoundReports"),
    Frame.NotificationType.HUMANIZED);

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

Screen screen = windowManager.create(screenId,
    openType.getOpenMode(),
    new MapScreenOptions(params));
  windowManager.showNotification(messages.getMainMessage("actions.Related.FilterNotFound"),
      Frame.NotificationType.WARNING);
windowManager.showNotification(messages.getMainMessage("actions.Related.NotSelected"),
    Frame.NotificationType.HUMANIZED);

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

/**
 * Open an edit screen for entity instance.
 *
 * @param item        entity to edit
 * @param openType    how to open the screen
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractEditor openEditor(Entity item, WindowManager.OpenType openType) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo editorScreen = windowConfig.getEditorScreen(item);
  return (AbstractEditor) getWindowManager().openEditor(editorScreen, item, openType);
}

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

/**
 * Open a lookup screen.
 *
 * @param entityClass required class of entity
 * @param handler     is invoked when selection confirmed and the lookup screen closes
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler,
                 WindowManager.OpenType openType, Map<String, Object> params) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass);
  return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType, params);
}

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

@Override
  public void showComponentName(WindowManager windowManager, String title, String message) {
    windowManager.showMessageDialog(title, message, Frame.MessageType.CONFIRMATION);
  }
}

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

wm.showNotification(
      messages.getMainMessage("OpenAction.objectIsDeleted"),
      Frame.NotificationType.HUMANIZED);
AbstractEditor editor = (AbstractEditor) wm.openEditor(
    windowConfig.getWindowInfo(windowAlias),
    entity,

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

/**
 * Open an edit screen.
 *
 * @param windowAlias screen ID as defined in {@code screens.xml}
 * @param item        entity to edit
 * @param openType    how to open the screen
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractEditor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
  return (AbstractEditor) getWindowManager().openEditor(windowInfo, item, openType);
}

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

/**
 * Open a lookup screen.
 *
 * @param entityClass required class of entity
 * @param handler     is invoked when selection confirmed and the lookup screen closes
 * @param openType    how to open the screen
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler,
                 WindowManager.OpenType openType) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass);
  return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType);
}

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

/**
 * Show message 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!
 *
 * @deprecated Use {@link Dialogs} bean instead.
 */
@Deprecated
default void showMessageDialog(String title, String message, Frame.MessageType messageType) {
  getWindowManager().showMessageDialog(title, message, messageType);
}

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

/**
 * Open a simple screen.
 *
 * @param windowAlias screen ID as defined in {@code screens.xml}
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 *
 * @deprecated Use {@link Screens} bean instead.
 */
@Deprecated
default AbstractWindow openWindow(String windowAlias, WindowManager.OpenType openType, Map<String, Object> params) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
  return (AbstractWindow) getWindowManager().openWindow(windowInfo, openType, params);
}

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

@Override
protected void doHandle(String className, String message, @Nullable Throwable throwable, WindowManager windowManager) {
  String msg = messages.getMessage(getClass(), "accessDenied.message");
  windowManager.showNotification(msg, Frame.NotificationType.ERROR);
}

代码示例来源: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

/**
 * Open an edit screen for entity instance.
 *
 * @param item        entity to edit
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractEditor openEditor(Entity item, WindowManager.OpenType openType,
                 Map<String, Object> params) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo editorScreen = windowConfig.getEditorScreen(item);
  return (AbstractEditor) getWindowManager().openEditor(editorScreen, item, openType, params);
}

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