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


Java PropertyKey类代码示例

本文整理汇总了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();
}
 
开发者ID:vsch,项目名称:MissingInActions,代码行数:17,代码来源:Bundle.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FindDialog.java

示例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;
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:10,代码来源:I18nSupport.java

示例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;
}
 
开发者ID:RetGal,项目名称:Dayon,代码行数:32,代码来源:Babylon.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CreateXmlElementIntentionAction.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JavaParserUtil.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ComponentType.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:Registry.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AddDtdDeclarationFix.java

示例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);
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:6,代码来源:Json2JavaBundle.java

示例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));
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:6,代码来源:SettingsPanelTest.java

示例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));
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:6,代码来源:SettingsPanelTest.java

示例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);
}
 
开发者ID:xylo,项目名称:intellij-postfix-templates,代码行数:5,代码来源:PostfixTemplatesBundle.java

示例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);
}
 
开发者ID:halirutan,项目名称:IntelliJ-Key-Promoter-X,代码行数:4,代码来源:KeyPromoterBundle.java

示例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);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:4,代码来源:KotlinTwitterBundle.java


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