本文整理匯總了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);
}