Java Code Examples for org.jetbrains.annotations.PropertyKey

The following are top voted examples for showing how to use org.jetbrains.annotations.PropertyKey. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: MissingInActions   File: Bundle.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 2
Project: intellij-ce-playground   File: FindDialog.java   Source Code and License 6 votes vote down vote up
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();
}
 
Example 3
Project: livingdoc-intellij   File: I18nSupport.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 4
Project: Dayon   File: Babylon.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 5
Project: intellij-ce-playground   File: CreateXmlElementIntentionAction.java   Source Code and License 5 votes vote down vote up
CreateXmlElementIntentionAction(
  @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
  @NonNls @NotNull String declarationTagName,
  TypeOrElementOrAttributeReference ref) {

  myMessageKey = messageKey;
  myRef = ref;
  myDeclarationTagName = declarationTagName;
}
 
Example 6
Project: intellij-ce-playground   File: JavaParserUtil.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 7
Project: intellij-ce-playground   File: JavaParserUtil.java   Source Code and License 5 votes vote down vote up
public static boolean expectOrError(PsiBuilder builder, IElementType expected, @PropertyKey(resourceBundle = JavaErrorMessages.BUNDLE) String key) {
  if (!PsiBuilderUtil.expect(builder, expected)) {
    error(builder, JavaErrorMessages.message(key));
    return false;
  }
  return true;
}
 
Example 8
Project: intellij-ce-playground   File: ComponentType.java   Source Code and License 5 votes vote down vote up
ComponentType(Class<? extends BaseComponent> clazz, @NonNls String name,
              @PropertyKey(resourceBundle = "org.jetbrains.idea.devkit.DevKitBundle") String propertyKey)
{
  myPropertyKey = propertyKey;
  myClassName = clazz.getName();
  myName = name;
}
 
Example 9
Project: intellij-ce-playground   File: Registry.java   Source Code and License 5 votes vote down vote up
public static boolean is(@PropertyKey(resourceBundle = REGISTRY_BUNDLE) @NotNull String key, boolean defaultValue) {
  try {
    return get(key).asBoolean();
  }
  catch (MissingResourceException ex) {
    return defaultValue;
  }
}
 
Example 10
Project: intellij-ce-playground   File: AddDtdDeclarationFix.java   Source Code and License 5 votes vote down vote up
public AddDtdDeclarationFix(
  @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String messageKey,
  @NotNull String elementDeclarationName,
  @NotNull PsiReference reference) {
  myMessageKey = messageKey;
  myElementDeclarationName = elementDeclarationName;
  myReference = reference.getCanonicalText();
}
 
Example 11
Project: json2java4idea   File: Json2JavaBundle.java   Source Code and License 4 votes vote down vote up
@Nonnull
@CheckReturnValue
public String message(@Nonnull @PropertyKey(resourceBundle = BUNDLE) String key, @Nonnull Object... objects) {
    return getMessage(key, objects);
}
 
Example 12
Project: json2java4idea   File: SettingsPanelTest.java   Source Code and License 4 votes vote down vote up
@Nonnull
@CheckReturnValue
private JRadioButtonFixture findRadioButtonByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
    return window.radioButton(bundle.message(key));
}
 
Example 13
Project: json2java4idea   File: SettingsPanelTest.java   Source Code and License 4 votes vote down vote up
@Nonnull
@CheckReturnValue
private JTextComponentFixture findTextFieldByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
    return window.textBox(bundle.message(key));
}
 
Example 14
Project: intellij-postfix-templates   File: PostfixTemplatesBundle.java   Source Code and License 4 votes vote down vote up
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
	return CommonBundle.message(BUNDLE, key, params);
}
 
Example 15
Project: IntelliJ-Key-Promoter-X   File: KeyPromoterBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = "de.halirutan.keypromoterx.messages.KeyPromoterBundle") String key, @NotNull Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 16
Project: educational-plugin   File: KotlinTwitterBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 17
Project: CodeGen   File: CodeGenBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
    return INSTANCE.getMessage(key, params);
}
 
Example 18
Project: manifold-ij   File: ManBundle.java   Source Code and License 4 votes vote down vote up
public static String message( @PropertyKey(resourceBundle = BUNDLE) String key, Object... params )
{
  return CommonBundle.message( ResourceBundle.getBundle( BUNDLE ), key, params );
}
 
Example 19
Project: idea-php-psr4-namespace-detector   File: MessageBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = "main.resource.Messages") String key, @NotNull Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 20
Project: lua-for-idea   File: LuaBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 21
Project: intellij-ce-playground   File: IdeaDecompilerBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return Holder.INSTANCE.getMessage(key, params);
}
 
Example 22
Project: lua-for-idea   File: PluginErrorReportSubmitterBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = "com.sylvanaar.idea.errorreporting.PluginErrorReportSubmitterBundle") String key,
                             Object... params) {
    return CommonBundle.message(OUR_BUNDLE, key, params);
}
 
Example 23
Project: catberry-idea-plugin   File: CatberryBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 24
Project: intellij-ce-playground   File: ProjectBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 25
Project: intellij-ce-playground   File: GitBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 26
Project: appCode-Swift-Extensions   File: SwiftBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 27
Project: intellij-ce-playground   File: HgVcsMessages.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull @Nullable Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 28
Project: intellij-ce-playground   File: GroovyDocBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 29
Project: MissingInActions   File: Bundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
    return CommonBundle.message(BUNDLE, key, params);
}
 
Example 30
Project: MissingInActions   File: Bundle.java   Source Code and License 4 votes vote down vote up
public static String messageOrBlank(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
    return CommonBundle.messageOrDefault(BUNDLE, key, "", params);
}
 
Example 31
Project: intellij-ce-playground   File: GitBundle.java   Source Code and License 4 votes vote down vote up
public static String getString(@PropertyKey(resourceBundle = BUNDLE) final String key) {
  return getBundle().getString(key);
}
 
Example 32
Project: protobuf-jetbrains-plugin   File: ProtostuffBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
    return CommonBundle.message(BUNDLE, key, params);
}
 
Example 33
Project: stylint-plugin   File: StylintBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
    return CommonBundle.message(getBundle(), key, params);
}
 
Example 34
Project: samebug-idea-plugin   File: MessageService.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
    return INSTANCE.internalMessage(key, params);
}
 
Example 35
Project: intellij-ce-playground   File: AntBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 36
Project: intellij-ce-playground   File: Test.java   Source Code and License 4 votes vote down vote up
public static String message(@org.jetbrains.annotations.NotNull @PropertyKey(resourceBundle = BUNDLE) String key,
                             @org.jetbrains.annotations.NotNull Object... params) {
  return "";
}
 
Example 37
Project: intellij-ce-playground   File: JavaCoreBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 38
Project: intellij-ce-playground   File: DebuggerBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 39
Project: intellij-ce-playground   File: HighlightUtil.java   Source Code and License 4 votes vote down vote up
Feature(@NotNull LanguageLevel level, @NotNull @PropertyKey(resourceBundle = JavaErrorMessages.BUNDLE) String key) {
  this.level = level;
  this.key = key;
}
 
Example 40
Project: intellij-ce-playground   File: AndroidJpsBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 41
Project: intellij-ce-playground   File: CompletionBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 42
Project: intellij-ce-playground   File: JavadocBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 43
Project: intellij-ce-playground   File: RefactorJBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = "com.intellij.refactoring.RefactorJBundle") String key,
                             @NotNull Object... params) {
  return CommonBundle.message(ourBundle, key, params);
}
 
Example 44
Project: intellij-ce-playground   File: GroovyRefactoringBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 45
Project: intellij-ce-playground   File: SpellCheckerBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) {
  return CommonBundle.message(BUNDLE, key, params);
}
 
Example 46
Project: intellij-ce-playground   File: RunnerBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return ourInstance.getMessage(key, params);
}
 
Example 47
Project: intellij-ce-playground   File: CloudBundle.java   Source Code and License 4 votes vote down vote up
public static String getText(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 48
Project: intellij-ce-playground   File: InspectionsBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull @NonNls Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 49
Project: intellij-ce-playground   File: DaemonBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 50
Project: intellij-ce-playground   File: XmlBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 51
Project: intellij-ce-playground   File: ExternalSystemBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return BUNDLE.getMessage(key, params);
}
 
Example 52
Project: intellij-ce-playground   File: OptionsBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 53
Project: intellij-ce-playground   File: KeyMapBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = "messages.KeyMapBundle") String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 54
Project: intellij-ce-playground   File: DiffBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 55
Project: intellij-ce-playground   File: FeatureStatisticsBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(key), key, params);
}
 
Example 56
Project: intellij-ce-playground   File: AndroidBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 57
Project: intellij-ce-playground   File: LocalHistoryBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 58
Project: intellij-ce-playground   File: TasksBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 59
Project: intellij-ce-playground   File: FindBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}
 
Example 60
Project: epigraph   File: SchemaBundle.java   Source Code and License 4 votes vote down vote up
public static String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
  return CommonBundle.message(getBundle(), key, params);
}