protected void init() {
    if (myWrapper != null) return;

    myProcessor = createProcessor();

    String dialogGroupKey = myProcessor.getContextUserData(DiffUserDataKeys.DIALOG_GROUP_KEY);
    if (dialogGroupKey == null) dialogGroupKey = "DiffContextDialog";

    myWrapper =
        new WindowWrapperBuilder(
                DiffUtil.getWindowMode(myHints), new MyPanel(myProcessor.getComponent()))
            .setProject(myProject)
            .setParent(myHints.getParent())
            .setDimensionServiceKey(dialogGroupKey)
            .setOnShowCallback(
                new Runnable() {
                  @Override
                  public void run() {
                    myProcessor.updateRequest();
                    myProcessor
                        .requestFocus(); // TODO: not needed for modal dialogs. Make a flag in
                                         // WindowWrapperBuilder ?
                  }
                })
            .build();
    myWrapper.setImage(ImageLoader.loadFromResource("/diff/Diff.png"));
    Disposer.register(myWrapper, myProcessor);

    new DumbAwareAction() {
      public void actionPerformed(final AnActionEvent e) {
        myWrapper.close();
      }
    }.registerCustomShortcutSet(CommonShortcuts.getCloseActiveWindow(), myProcessor.getComponent());
  }
 protected void onAfterNavigate() {
   DiffUtil.closeWindow(myWrapper.getWindow(), true, true);
 }
 protected void setWindowTitle(@NotNull String title) {
   myWrapper.setTitle(title);
 }
 public void show() {
   init();
   myWrapper.show();
 }