本文整理汇总了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;
}
示例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 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;
}
示例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);
}
示例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;
}