Ejemplo n.º 1
0
  private void createDialog(
      @Nullable Window owner,
      boolean canBeParent,
      @NotNull DialogWrapper.IdeModalityType ideModalityType) {
    if (isHeadless()) {
      myDialog = new HeadlessDialog();
      return;
    }

    myDialog =
        new MyDialog(
            owner,
            myWrapper,
            myProject,
            myWindowFocusedCallback,
            myTypeAheadDone,
            myTypeAheadCallback);
    myDialog.setModalityType(ideModalityType.toAwtModality());

    myCanBeParent = canBeParent;
  }
Ejemplo n.º 2
0
  public DialogWrapperPeerImpl(
      @NotNull final DialogWrapper wrapper,
      final Window owner,
      final boolean canBeParent,
      final DialogWrapper.IdeModalityType ideModalityType) {
    myWrapper = wrapper;
    myWindowManager = null;
    Application application = ApplicationManager.getApplication();
    if (application != null && application.hasComponent(WindowManager.class)) {
      myWindowManager = (WindowManagerEx) WindowManager.getInstance();
    }
    createDialog(owner, canBeParent);

    if (!isHeadless()) {
      Dialog.ModalityType modalityType = DialogWrapper.IdeModalityType.IDE.toAwtModality();
      if (Registry.is("ide.perProjectModality")) {
        modalityType = ideModalityType.toAwtModality();
      }
      myDialog.setModalityType(modalityType);
    }
  }