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

项目:intellij-ce-playground    文件:JavaI18nizeQuickFixDialog.java   
public String getI18nizedText() {
  String propertyKey = StringUtil.escapeStringCharacters(getKey());
  I18nizedTextGenerator textGenerator = myResourceBundleManager.getI18nizedTextGenerator();
  if (textGenerator != null) {
    return generateText(textGenerator, propertyKey, getPropertiesFile(), myLiteralExpression);
  }

  String templateName = getTemplateName();
  LOG.assertTrue(templateName != null);
  FileTemplate template = FileTemplateManager.getInstance(myProject).getCodeTemplate(templateName);
  Map<String, String> attributes = new THashMap<String, String>();
  attributes.put(PROPERTY_KEY_OPTION_KEY, propertyKey);
  attributes.put(RESOURCE_BUNDLE_OPTION_KEY, getResourceBundleText());
  attributes.put(PROPERTY_VALUE_ATTR, StringUtil.escapeStringCharacters(myDefaultPropertyValue));
  addAdditionalAttributes(attributes);
  String text = null;
  try {
    text = template.getText(attributes);
  }
  catch (IOException e) {
    LOG.error(e);
  }
  return text;
}
项目:tools-idea    文件:JavaI18nizeQuickFixDialog.java   
public String getI18nizedText() {
  String propertyKey = StringUtil.escapeStringCharacters(getKey());
  I18nizedTextGenerator textGenerator = myResourceBundleManager.getI18nizedTextGenerator();
  if (textGenerator != null) {
    return generateText(textGenerator, propertyKey, getPropertiesFile(), myLiteralExpression);
  }

  String templateName = getTemplateName();
  LOG.assertTrue(templateName != null);
  FileTemplate template = FileTemplateManager.getInstance().getCodeTemplate(templateName);
  Map<String, String> attributes = new THashMap<String, String>();
  attributes.put(PROPERTY_KEY_OPTION_KEY, propertyKey);
  attributes.put(RESOURCE_BUNDLE_OPTION_KEY, getResourceBundleText());
  attributes.put(PROPERTY_VALUE_ATTR, StringUtil.escapeStringCharacters(myDefaultPropertyValue));
  addAdditionalAttributes(attributes);
  String text = null;
  try {
    text = template.getText(attributes);
  }
  catch (IOException e) {
    LOG.error(e);
  }
  return text;
}
项目:consulo-java    文件:JavaI18nizeQuickFixDialog.java   
public String getI18nizedText() {
  String propertyKey = StringUtil.escapeStringCharacters(getKey());
  I18nizedTextGenerator textGenerator = myResourceBundleManager.getI18nizedTextGenerator();
  if (textGenerator != null) {
    return generateText(textGenerator, propertyKey, getPropertiesFile(), myLiteralExpression);
  }

  String templateName = getTemplateName();
  LOG.assertTrue(templateName != null);
  FileTemplate template = FileTemplateManager.getInstance(myProject).getCodeTemplate(templateName);
  Map<String, String> attributes = new THashMap<String, String>();
  attributes.put(PROPERTY_KEY_OPTION_KEY, propertyKey);
  attributes.put(RESOURCE_BUNDLE_OPTION_KEY, getResourceBundleText());
  attributes.put(PROPERTY_VALUE_ATTR, StringUtil.escapeStringCharacters(myDefaultPropertyValue));
  addAdditionalAttributes(attributes);
  String text = null;
  try {
    text = template.getText(attributes);
  }
  catch (IOException e) {
    LOG.error(e);
  }
  return text;
}
项目:intellij-ce-playground    文件:JavaI18nizeQuickFixDialog.java   
protected String generateText(final I18nizedTextGenerator textGenerator,
                              final String propertyKey,
                              final PropertiesFile propertiesFile,
                              final PsiLiteralExpression literalExpression) {
  return textGenerator.getI18nizedText(propertyKey, propertiesFile, literalExpression);
}
项目:tools-idea    文件:JavaI18nizeQuickFixDialog.java   
protected String generateText(final I18nizedTextGenerator textGenerator,
                              final String propertyKey,
                              final PropertiesFile propertiesFile,
                              final PsiLiteralExpression literalExpression) {
  return textGenerator.getI18nizedText(propertyKey, propertiesFile, literalExpression);
}
项目:consulo-java    文件:JavaI18nizeQuickFixDialog.java   
protected String generateText(final I18nizedTextGenerator textGenerator,
                              final String propertyKey,
                              final PropertiesFile propertiesFile,
                              final PsiLiteralExpression literalExpression) {
  return textGenerator.getI18nizedText(propertyKey, propertiesFile, literalExpression);
}