This commit is contained in:
Alexey Kudravtsev
2013-12-25 14:20:45 +04:00
parent 8cbb8a332d
commit d70cd0856c
85 changed files with 515 additions and 432 deletions
@@ -18,6 +18,7 @@ package com.jetbrains.rest;
import com.intellij.CommonBundle;
import com.intellij.reference.SoftReference;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;
import java.lang.ref.Reference;
@@ -29,18 +30,18 @@ import java.util.ResourceBundle;
* User : catherine
*/
public class RestBundle {
private static Reference<ResourceBundle> ourBundle;
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls
private static final String BUNDLE = "com.jetbrains.rest.RestBundle";
private RestBundle() {
}
public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
// Cached loading
private static ResourceBundle getBundle() {
ResourceBundle bundle = SoftReference.dereference(ourBundle);