本文整理汇总了Java中org.jetbrains.annotations.PropertyKey类的典型用法代码示例。如果您正苦于以下问题:Java PropertyKey类的具体用法?Java PropertyKey怎么用?Java PropertyKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyKey类属于org.jetbrains.annotations包,在下文中一共展示了PropertyKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: indexedMessage
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static String indexedMessage(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
StringBuilder sb = new StringBuilder();
String sep = "";
int index = 0;
while (true) {
String message = messageOrNull(BUNDLE, index++ > 0 ? String.format("%s-%d", key, index) : key, params);
if (message == null) {
if (index > 0) break;
}
else {
sb.append(sep).append(message);
sep = "\n";
}
}
return sb.toString();
}
示例2: getPresentableName
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static String getPresentableName(@NotNull FindModel.SearchContext searchContext) {
@PropertyKey(resourceBundle = "messages.FindBundle") String messageKey = null;
if (searchContext == FindModel.SearchContext.ANY) {
messageKey = "find.context.anywhere.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS) {
messageKey = "find.context.except.comments.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_STRING_LITERALS) {
messageKey = "find.context.except.literals.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS) {
messageKey = "find.context.except.comments.and.literals.scope.label";
} else if (searchContext == FindModel.SearchContext.IN_COMMENTS) {
messageKey = "find.context.in.comments.scope.label";
} else if (searchContext == FindModel.SearchContext.IN_STRING_LITERALS) {
messageKey = "find.context.in.literals.scope.label";
}
return messageKey != null ? FindBundle.message(messageKey) : searchContext.toString();
}
示例3: if
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static String getValue
(@PropertyKey(resourceBundle = BUNDLE_PATH) String key, Object... params) {
String value = bundle.getString(key);
if (params.length > 0) {
return MessageFormat.format(value, params);
}
return value;
}
示例4: translate
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static synchronized String translate(@PropertyKey(resourceBundle = BUNDLE) String tag, Object... arguments) {
final Locale locale = Locale.getDefault();
final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE, locale);
String value;
try {
value = bundle.getString(tag);
if (value.trim().length() == 0) {
value = tag;
}
if (arguments != null && arguments.length > 0) {
value = formatValue(locale, value, tag, arguments);
}
} catch (MissingResourceException ignored) {
value = tag;
if (arguments != null && arguments.length > 0) {
value = formatValue(locale, value, tag, arguments);
}
}
if (value != null) {
value = value.trim();
}
return value;
}
示例5: CreateXmlElementIntentionAction
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
CreateXmlElementIntentionAction(
@PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
@NonNls @NotNull String declarationTagName,
TypeOrElementOrAttributeReference ref) {
myMessageKey = messageKey;
myRef = ref;
myDeclarationTagName = declarationTagName;
}
示例6: expectOrError
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static boolean expectOrError(PsiBuilder builder, TokenSet expected, @PropertyKey(resourceBundle = JavaErrorMessages.BUNDLE) String key) {
if (!PsiBuilderUtil.expect(builder, expected)) {
error(builder, JavaErrorMessages.message(key));
return false;
}
return true;
}
示例7: ComponentType
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
ComponentType(Class<? extends BaseComponent> clazz, @NonNls String name,
@PropertyKey(resourceBundle = "org.jetbrains.idea.devkit.DevKitBundle") String propertyKey)
{
myPropertyKey = propertyKey;
myClassName = clazz.getName();
myName = name;
}
示例8: is
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static boolean is(@PropertyKey(resourceBundle = REGISTRY_BUNDLE) @NotNull String key, boolean defaultValue) {
try {
return get(key).asBoolean();
}
catch (MissingResourceException ex) {
return defaultValue;
}
}
示例9: AddDtdDeclarationFix
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public AddDtdDeclarationFix(
@PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
@NotNull String elementDeclarationName,
@NotNull PsiReference reference) {
myMessageKey = messageKey;
myElementDeclarationName = elementDeclarationName;
myReference = reference.getCanonicalText();
}
示例10: message
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
@Nonnull
@CheckReturnValue
public String message(@Nonnull @PropertyKey(resourceBundle = BUNDLE) String key, @Nonnull Object... objects) {
return getMessage(key, objects);
}
示例11: findRadioButtonByName
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
@Nonnull
@CheckReturnValue
private JRadioButtonFixture findRadioButtonByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
return window.radioButton(bundle.message(key));
}
示例12: findTextFieldByName
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
@Nonnull
@CheckReturnValue
private JTextComponentFixture findTextFieldByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
return window.textBox(bundle.message(key));
}
示例13: message
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
return CommonBundle.message(BUNDLE, key, params);
}
示例14: message
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static String message(@NotNull @PropertyKey(resourceBundle = "de.halirutan.keypromoterx.messages.KeyPromoterBundle") String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
示例15: message
import org.jetbrains.annotations.PropertyKey; //导入依赖的package包/类
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}