本文整理匯總了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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}