@Override
  public boolean isPartOf(@NotNull JFrame frame, @Nullable Project project) {
    if (project != null && myProject != null) {
      return project == myProject;
    }
    if (myDialog != null) {
      DialogWrapper popup = myDialog.getPopup();
      if (popup != null) {
        return UIUtil.isAncestor(frame, popup.getOwner());
      }
    }
    return false;
  }
@Override
  public boolean isPartOf(@NotNull JFrame frame, @Nullable Project project)