コード例 #1
0
 @Nullable
 private String getLocalizedString(String bundleName, String key) {
   final String baseName =
       bundleName != null
           ? bundleName
           : bundle == null
               ? ((IdeaPluginDescriptor) myPluginDescriptor).getResourceBundleBaseName()
               : bundle;
   if (baseName == null || key == null) {
     if (bundleName != null) {
       LOG.warn(implementationClass);
     }
     return null;
   }
   final ResourceBundle resourceBundle =
       AbstractBundle.getResourceBundle(baseName, myPluginDescriptor.getPluginClassLoader());
   return CommonBundle.message(resourceBundle, key);
 }
コード例 #2
0
  private String computeDescription() {
    ResourceBundle bundle = null;
    if (myResourceBundleBaseName != null) {
      try {
        bundle = AbstractBundle.getResourceBundle(myResourceBundleBaseName, getPluginClassLoader());
      } catch (MissingResourceException e) {
        LOG.info("Cannot find plugin " + myId + " resource-bundle: " + myResourceBundleBaseName);
      }
    }

    if (bundle == null) {
      return myDescriptionChildText;
    }

    return CommonBundle.messageOrDefault(
        bundle,
        createDescriptionKey(myId),
        myDescriptionChildText == null ? "" : myDescriptionChildText);
  }