本文整理汇总了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);
}