當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。