more bundles

GitOrigin-RevId: 5f1d33872141e8a0b14596a030e144ec27c55b03
This commit is contained in:
Sergey Ignatov
2019-12-20 20:35:32 +00:00
committed by intellij-monorepo-bot
parent ad36981e0a
commit d73aa0a711
3 changed files with 22 additions and 66 deletions
@@ -15,33 +15,19 @@
*/
package org.jetbrains.plugins.groovy.actions.generate;
import com.intellij.DynamicBundle;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;
import java.util.ResourceBundle;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
public class GroovyCodeInsightBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "org.jetbrains.plugins.groovy.actions.generate.GroovyCodeInsightBundle";
private static final GroovyCodeInsightBundle INSTANCE = new GroovyCodeInsightBundle();
import com.intellij.CommonBundle;
public class GroovyCodeInsightBundle {
private GroovyCodeInsightBundle() { super(BUNDLE); }
@NotNull
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 = "org.jetbrains.plugins.groovy.actions.generate.GroovyCodeInsightBundle";
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
return INSTANCE.getMessage(key, params);
}
}
@@ -16,33 +16,20 @@
package org.jetbrains.plugins.groovy.doc;
import com.intellij.CommonBundle;
import com.intellij.DynamicBundle;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.util.ResourceBundle;
public class GroovyDocBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "org.jetbrains.plugins.groovy.doc.GroovyDocBundle";
private static final GroovyDocBundle INSTANCE = new GroovyDocBundle();
public class GroovyDocBundle {
private GroovyDocBundle() { super(BUNDLE); }
@NotNull
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 = "org.jetbrains.plugins.groovy.doc.GroovyDocBundle";
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
return INSTANCE.getMessage(key, params);
}
}
@@ -16,36 +16,19 @@
package org.jetbrains.plugins.groovy.refactoring;
import org.jetbrains.annotations.NotNull;
import com.intellij.DynamicBundle;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;
import java.util.ResourceBundle;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
public class GroovyRefactoringBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle";
private static final GroovyRefactoringBundle INSTANCE = new GroovyRefactoringBundle();
import com.intellij.CommonBundle;
/**
* @author ilyas
*/
public class GroovyRefactoringBundle {
private GroovyRefactoringBundle() { super(BUNDLE); }
@NotNull
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 = "org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle";
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
return INSTANCE.getMessage(key, params);
}
}