本文整理汇总了Java中com.intellij.openapi.ui.Messages.YesNoResult方法的典型用法代码示例。如果您正苦于以下问题:Java Messages.YesNoResult方法的具体用法?Java Messages.YesNoResult怎么用?Java Messages.YesNoResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.Messages
的用法示例。
在下文中一共展示了Messages.YesNoResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showYesNoDialog
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Messages.YesNoResult
private static int showYesNoDialog(Component parentComponent, Project project, String message, String title, Icon icon) {
if (parentComponent.isShowing()) {
return Messages.showYesNoDialog(parentComponent, message, title, icon);
}
else {
return Messages.showYesNoDialog(project, message, title, icon);
}
}
示例2: navigateToStarted
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
private static void navigateToStarted(final Document oldDocument, final Project project, @Messages.YesNoResult final int exitCode) {
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(oldDocument);
if (file != null) {
final VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile != null) {
final FileEditor[] editors = FileEditorManager.getInstance(project).getEditors(virtualFile);
for (FileEditor editor : editors) {
if (editor instanceof TextEditor) {
final Editor textEditor = ((TextEditor)editor).getEditor();
final TemplateState templateState = TemplateManagerImpl.getTemplateState(textEditor);
if (templateState != null) {
if (exitCode == Messages.YES) {
final TextRange range = templateState.getVariableRange(PRIMARY_VARIABLE_NAME);
if (range != null) {
new OpenFileDescriptor(project, virtualFile, range.getStartOffset()).navigate(true);
return;
}
}
else if (exitCode > 0){
templateState.gotoEnd();
return;
}
}
}
}
}
}
}
示例3: showYesNoDialog
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Messages.YesNoResult
public static boolean showYesNoDialog(@Nullable Project project,
@NotNull String title,
@NotNull String message,
@NotNull DialogWrapper.DoNotAskOption doNotAskOption) {
return Messages.YES == Messages.showYesNoDialog(project, message, title, Messages.getQuestionIcon(), doNotAskOption);
}
示例4: showYesNoDialog
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
/**
* @return {@link Messages#YES} if user pressed "Yes" or {@link Messages#NO} if user pressed "No" button.
*/
@Messages.YesNoResult
public abstract int showYesNoDialog(@NotNull String title, String message, @NotNull String yesButton, @NotNull String noButton, @Nullable Window window,
@Nullable DialogWrapper.DoNotAskOption doNotAskDialogOption);
示例5: showRestartDialog
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Messages.YesNoResult
public static int showRestartDialog() {
return showRestartDialog(IdeBundle.message("update.notifications.title"));
}
示例6: navigateToAlreadyStarted
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
protected void navigateToAlreadyStarted(Document oldDocument, @Messages.YesNoResult int exitCode) {
navigateToStarted(oldDocument, myProject, exitCode);
}