当前位置: 首页>>代码示例>>Java>>正文


Java WarnOnDeletion类代码示例

本文整理汇总了Java中com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion的典型用法代码示例。如果您正苦于以下问题:Java WarnOnDeletion类的具体用法?Java WarnOnDeletion怎么用?Java WarnOnDeletion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WarnOnDeletion类属于com.intellij.openapi.diff.impl.dir.actions.popup包,在下文中一共展示了WarnOnDeletion类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCanDelete

import com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion; //导入依赖的package包/类
private boolean checkCanDelete(List<DirDiffElementImpl> elements) {
  if (WarnOnDeletion.isWarnWhenDeleteItems()) {
    int count = 0;
    for (DirDiffElementImpl element : elements) {
      if (element.getOperation() == DirDiffOperation.DELETE) {
        count++;
      }
    }
    if (count > 0) {
      if (!confirmDeletion(count)) {
        return false;
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DirDiffTableModel.java

示例2: checkCanDelete

import com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion; //导入依赖的package包/类
private boolean checkCanDelete() {
  if (WarnOnDeletion.isWarnWhenDeleteItems()) {
    int count = 0;
    for (DirDiffElementImpl element : myElements) {
      if (element.getOperation() == DirDiffOperation.DELETE) {
        count++;
      }
    }
    if (count > 0) {
      if (!confirmDeletion(count)) {
        return false;
      }
    }
  }
  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:DirDiffTableModel.java

示例3: confirmDeletion

import com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion; //导入依赖的package包/类
private boolean confirmDeletion(int count) {
  return MessageDialogBuilder.yesNo("Confirm Delete", "Delete " + count + " items?").project(myProject).yesText("Delete").noText(CommonBundle.message("button.cancel")).doNotAsk(
    new DialogWrapper.DoNotAskOption() {
      @Override
      public boolean isToBeShown() {
        return WarnOnDeletion.isWarnWhenDeleteItems();
      }

      @Override
      public void setToBeShown(boolean value, int exitCode) {
        WarnOnDeletion.setWarnWhenDeleteItems(value);
      }

      @Override
      public boolean canBeHidden() {
        return true;
      }

      @Override
      public boolean shouldSaveOptionsOnCancel() {
        return true;
      }

      @NotNull
      @Override
      public String getDoNotShowMessage() {
        return "Do not ask me again";
      }
    }).show() == Messages.YES;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:DirDiffTableModel.java

示例4: confirmDeletion

import com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion; //导入依赖的package包/类
private static boolean confirmDeletion(int count) {
  DialogWrapper.DoNotAskOption option = new DialogWrapper.DoNotAskOption() {
    @Override
    public boolean isToBeShown() {
      return WarnOnDeletion.isWarnWhenDeleteItems();
    }

    @Override
    public void setToBeShown(boolean value, int exitCode) {
      WarnOnDeletion.setWarnWhenDeleteItems(value);
    }

    @Override
    public boolean canBeHidden() {
      return true;
    }

    @Override
    public boolean shouldSaveOptionsOnCancel() {
      return true;
    }

    @Override
    public String getDoNotShowMessage() {
      return "Do not ask me again";
    }
  };

  return DialogWrapper.OK_EXIT_CODE == Messages.showYesNoDialog("Delete " + count + " items?", "Confirm Delete",
                                                                "Delete",
                                                                CommonBundle.message("button.cancel"),
                                                                Messages.getQuestionIcon(),
                                                                option);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:35,代码来源:DirDiffTableModel.java

示例5: confirmDeletion

import com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion; //导入依赖的package包/类
private boolean confirmDeletion(int count) {
  return MessageDialogBuilder.yesNo("Confirm Delete", "Delete " + count + " items?").project(myProject).yesText("Delete").noText(CommonBundle.message("button.cancel")).doNotAsk(
          new DialogWrapper.DoNotAskOption() {
            @Override
            public boolean isToBeShown() {
              return WarnOnDeletion.isWarnWhenDeleteItems();
            }

            @Override
            public void setToBeShown(boolean value, int exitCode) {
              WarnOnDeletion.setWarnWhenDeleteItems(value);
            }

            @Override
            public boolean canBeHidden() {
              return true;
            }

            @Override
            public boolean shouldSaveOptionsOnCancel() {
              return true;
            }

            @Nonnull
            @Override
            public String getDoNotShowMessage() {
              return "Do not ask me again";
            }
          }).show() == Messages.YES;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:DirDiffTableModel.java


注:本文中的com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。