Java 类com.intellij.lang.properties.psi.ResourceBundleManager 实例源码

项目:intellij-ce-playground    文件:JavaI18nizeQuickFixDialog.java   
public static boolean isAvailable(PsiFile file) {
  final Project project = file.getProject();
  final String title = CodeInsightBundle.message("i18nize.dialog.error.jdk.title");
  try {
    return ResourceBundleManager.getManager(file) != null;
  }
  catch (ResourceBundleManager.ResourceBundleNotFoundException e) {
    final IntentionAction fix = e.getFix();
    if (fix != null) {
      if (Messages.showOkCancelDialog(project, e.getMessage(), title, Messages.getErrorIcon()) == Messages.OK) {
        try {
          fix.invoke(project, null, file);
          return false;
        }
        catch (IncorrectOperationException e1) {
          LOG.error(e1);
        }
      }
    }
    Messages.showErrorDialog(project, e.getMessage(), title);
    return false;
  }
}
项目:tools-idea    文件:JavaI18nizeQuickFixDialog.java   
public static boolean isAvailable(PsiFile file) {
  final Project project = file.getProject();
  final String title = CodeInsightBundle.message("i18nize.dialog.error.jdk.title");
  try {
    return ResourceBundleManager.getManager(file) != null;
  }
  catch (ResourceBundleManager.ResourceBundleNotFoundException e) {
    final IntentionAction fix = e.getFix();
    if (fix != null) {
      if (Messages.showOkCancelDialog(project, e.getMessage(), title, Messages.getErrorIcon()) == OK_EXIT_CODE) {
        try {
          fix.invoke(project, null, file);
          return false;
        }
        catch (IncorrectOperationException e1) {
          LOG.error(e1);
        }
      }
    }
    Messages.showErrorDialog(project, e.getMessage(), title);
    return false;
  }
}
项目:consulo-java    文件:JavaI18nizeQuickFixDialog.java   
public static boolean isAvailable(PsiFile file) {
  final Project project = file.getProject();
  final String title = CodeInsightBundle.message("i18nize.dialog.error.jdk.title");
  try {
    return ResourceBundleManager.getManager(file) != null;
  }
  catch (ResourceBundleManager.ResourceBundleNotFoundException e) {
    final IntentionAction fix = e.getFix();
    if (fix != null) {
      if (Messages.showOkCancelDialog(project, e.getMessage(), title, Messages.getErrorIcon()) == OK_EXIT_CODE) {
        try {
          fix.invoke(project, null, file);
          return false;
        }
        catch (IncorrectOperationException e1) {
          LOG.error(e1);
        }
      }
    }
    Messages.showErrorDialog(project, e.getMessage(), title);
    return false;
  }
}