当前位置: 首页>>代码示例>>Java>>正文


Java CommonBundle.messageOrDefault方法代码示例

本文整理汇总了Java中com.intellij.CommonBundle.messageOrDefault方法的典型用法代码示例。如果您正苦于以下问题:Java CommonBundle.messageOrDefault方法的具体用法?Java CommonBundle.messageOrDefault怎么用?Java CommonBundle.messageOrDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.CommonBundle的用法示例。


在下文中一共展示了CommonBundle.messageOrDefault方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeDescription

import com.intellij.CommonBundle; //导入方法依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:IdeaPluginDescriptorImpl.java

示例2: messageOrNull

import com.intellij.CommonBundle; //导入方法依赖的package包/类
@Nullable
public static String messageOrNull(@NotNull ResourceBundle bundle, @NotNull String key,
        @NotNull Object... params) {
    final String value = CommonBundle.messageOrDefault(bundle, key, key, params);
    if (key.equals(value)) return null;
    return value;
}
 
开发者ID:vsch,项目名称:MissingInActions,代码行数:8,代码来源:Bundle.java

示例3: loadDescriptionForElement

import com.intellij.CommonBundle; //导入方法依赖的package包/类
private static String loadDescriptionForElement(final Element element, final ResourceBundle bundle, final String id, String elementType) {
  final String value = element.getAttributeValue(DESCRIPTION);
  if (bundle != null) {
    @NonNls final String key = elementType + "." + id + ".description";
    return CommonBundle.messageOrDefault(bundle, key, value == null ? "" : value);
  } else {
    return value;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ActionManagerImpl.java

示例4: messageOrBlank

import com.intellij.CommonBundle; //导入方法依赖的package包/类
public static String messageOrBlank(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
    return CommonBundle.messageOrDefault(BUNDLE, key, "", params);
}
 
开发者ID:vsch,项目名称:MissingInActions,代码行数:4,代码来源:Bundle.java

示例5: loadTextForElement

import com.intellij.CommonBundle; //导入方法依赖的package包/类
private static String loadTextForElement(final Element element, final ResourceBundle bundle, final String id, String elementType) {
  final String value = element.getAttributeValue(TEXT_ATTR_NAME);
  return CommonBundle.messageOrDefault(bundle, elementType + "." + id + "." + TEXT_ATTR_NAME, value == null ? "" : value);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ActionManagerImpl.java

示例6: messageOrDefault

import com.intellij.CommonBundle; //导入方法依赖的package包/类
public static String messageOrDefault(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key,
                                      String defaultValue,
                                      @NotNull Object... params) {
  return CommonBundle.messageOrDefault(getBundle(), key, defaultValue, params);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:GradleDocumentationBundle.java

示例7: defaultableMessage

import com.intellij.CommonBundle; //导入方法依赖的package包/类
public static String defaultableMessage(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
  return CommonBundle.messageOrDefault(getBundle(), key, "default", true, (Object[])params);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:IntentionPowerPackBundle.java

示例8: messageOrBlank

import com.intellij.CommonBundle; //导入方法依赖的package包/类
/**
 * Load a {@link String} from the {@link #BUNDLE} {@link ResourceBundle}.
 *
 * @param key    the key of the resource.
 * @param params the optional parameters for the specific resource.
 * @return the {@link String} value or an empty {@link String} if no resource found for the key.
 */
public static String messageOrBlank(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
    return CommonBundle.messageOrDefault(BUNDLE, key, "test:foo", params);
}
 
开发者ID:misakuo,项目名称:weex-language-support,代码行数:11,代码来源:WeexBundle.java


注:本文中的com.intellij.CommonBundle.messageOrDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。