本文整理汇总了Java中com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion.isWarnWhenDeleteItems方法的典型用法代码示例。如果您正苦于以下问题:Java WarnOnDeletion.isWarnWhenDeleteItems方法的具体用法?Java WarnOnDeletion.isWarnWhenDeleteItems怎么用?Java WarnOnDeletion.isWarnWhenDeleteItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.diff.impl.dir.actions.popup.WarnOnDeletion
的用法示例。
在下文中一共展示了WarnOnDeletion.isWarnWhenDeleteItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: 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);
}