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

项目:intellij-ce-playground    文件:I18nizeQuickFix.java   
@Override
public void performI18nization(final PsiFile psiFile,
                               final Editor editor,
                               PsiLiteralExpression literalExpression,
                               Collection<PropertiesFile> propertiesFiles,
                               String key, String value, String i18nizedText,
                               PsiExpression[] parameters,
                               final PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException {
  Project project = psiFile.getProject();
  propertyCreationHandler.createProperty(project, propertiesFiles, key, value, parameters);
  try {
    final PsiElement newExpression = doReplacementInJava(psiFile, editor,literalExpression, i18nizedText);
    reformatAndCorrectReferences(newExpression);
  }
  catch (IncorrectOperationException e) {
    Messages.showErrorDialog(project, CodeInsightBundle.message("inspection.i18n.expression.is.invalid.error.message"),
                             CodeInsightBundle.message("inspection.error.dialog.title"));
  }
}
项目:tools-idea    文件:I18nizeQuickFix.java   
@Override
public void performI18nization(final PsiFile psiFile,
                               final Editor editor,
                               PsiLiteralExpression literalExpression,
                               Collection<PropertiesFile> propertiesFiles,
                               String key, String value, String i18nizedText,
                               PsiExpression[] parameters,
                               final PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException {
  Project project = psiFile.getProject();
  propertyCreationHandler.createProperty(project, propertiesFiles, key, value, parameters);
  try {
    final PsiElement newExpression = doReplacementInJava(psiFile, editor,literalExpression, i18nizedText);
    reformatAndCorrectReferences(newExpression);
  }
  catch (IncorrectOperationException e) {
    Messages.showErrorDialog(project, CodeInsightBundle.message("inspection.i18n.expression.is.invalid.error.message"),
                             CodeInsightBundle.message("inspection.error.dialog.title"));
  }
}
项目:consulo-java    文件:I18nizeQuickFix.java   
@Override
public void performI18nization(final PsiFile psiFile,
                               final Editor editor,
                               PsiLiteralExpression literalExpression,
                               Collection<PropertiesFile> propertiesFiles,
                               String key, String value, String i18nizedText,
                               PsiExpression[] parameters,
                               final PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException {
  Project project = psiFile.getProject();
  propertyCreationHandler.createProperty(project, propertiesFiles, key, value, parameters);
  try {
    final PsiElement newExpression = doReplacementInJava(psiFile, editor,literalExpression, i18nizedText);
    reformatAndCorrectReferences(newExpression);
  }
  catch (IncorrectOperationException e) {
    Messages.showErrorDialog(project, CodeInsightBundle.message("inspection.i18n.expression.is.invalid.error.message"),
                             CodeInsightBundle.message("inspection.error.dialog.title"));
  }
}
项目:intellij-ce-playground    文件:I18nQuickFixHandler.java   
void performI18nization(final PsiFile psiFile,
final Editor editor,
PsiLiteralExpression literalExpression,
Collection<PropertiesFile> propertiesFiles,
String key,
String value,
String i18nizedText,
PsiExpression[] parameters,
PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException;
项目:intellij-ce-playground    文件:I18nizeJspHandlerProvider.java   
@Override
public void performI18nization(final PsiFile psiFile,
                               final Editor editor,
                               PsiLiteralExpression literalExpression,
                               Collection<PropertiesFile> propertiesFiles,
                               String key, String value, String i18nizedText,
                               PsiExpression[] parameters,
                               final PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException {
  Project project = psiFile.getProject();
  TextRange selectedText = JavaI18nUtil.getSelectedRange(editor, psiFile);
  if (selectedText == null) return;
  propertyCreationHandler.createProperty(project, propertiesFiles, key, value, parameters);
  editor.getDocument().replaceString(selectedText.getStartOffset(), selectedText.getEndOffset(), i18nizedText);
}
项目:tools-idea    文件:I18nQuickFixHandler.java   
void performI18nization(final PsiFile psiFile,
final Editor editor,
PsiLiteralExpression literalExpression,
Collection<PropertiesFile> propertiesFiles,
String key,
String value,
String i18nizedText,
PsiExpression[] parameters,
PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException;
项目:tools-idea    文件:I18nizeJspHandlerProvider.java   
@Override
public void performI18nization(final PsiFile psiFile,
                               final Editor editor,
                               PsiLiteralExpression literalExpression,
                               Collection<PropertiesFile> propertiesFiles,
                               String key, String value, String i18nizedText,
                               PsiExpression[] parameters,
                               final PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException {
  Project project = psiFile.getProject();
  TextRange selectedText = JavaI18nUtil.getSelectedRange(editor, psiFile);
  if (selectedText == null) return;
  propertyCreationHandler.createProperty(project, propertiesFiles, key, value, parameters);
  editor.getDocument().replaceString(selectedText.getStartOffset(), selectedText.getEndOffset(), i18nizedText);
}
项目:consulo-java    文件:I18nQuickFixHandler.java   
void performI18nization(final PsiFile psiFile,
final Editor editor,
PsiLiteralExpression literalExpression,
Collection<PropertiesFile> propertiesFiles,
String key,
String value,
String i18nizedText,
PsiExpression[] parameters,
PropertyCreationHandler propertyCreationHandler) throws IncorrectOperationException;
项目:intellij-ce-playground    文件:JavaI18nizeQuickFixDialog.java   
public PropertyCreationHandler getPropertyCreationHandler() {
  PropertyCreationHandler handler = myResourceBundleManager.getPropertyCreationHandler();
  return handler != null ? handler : JavaI18nUtil.DEFAULT_PROPERTY_CREATION_HANDLER;
}
项目:tools-idea    文件:JavaI18nizeQuickFixDialog.java   
public PropertyCreationHandler getPropertyCreationHandler() {
  PropertyCreationHandler handler = myResourceBundleManager.getPropertyCreationHandler();
  return handler != null ? handler : JavaI18nUtil.DEFAULT_PROPERTY_CREATION_HANDLER;
}
项目:consulo-java    文件:JavaI18nizeQuickFixDialog.java   
public PropertyCreationHandler getPropertyCreationHandler() {
  PropertyCreationHandler handler = myResourceBundleManager.getPropertyCreationHandler();
  return handler != null ? handler : JavaI18nUtil.DEFAULT_PROPERTY_CREATION_HANDLER;
}