more bundles

GitOrigin-RevId: 4758e170499a62ec2d5437c31166bef8d08d0175
This commit is contained in:
Sergey Ignatov
2019-12-19 13:32:33 +00:00
committed by intellij-monorepo-bot
parent da3481c814
commit fdd69d0e2f
11 changed files with 94 additions and 274 deletions
@@ -15,36 +15,19 @@
*/
package com.intellij.analysis;
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;
/**
* @author max
*/
public class AnalysisScopeBundle {
private static Reference<ResourceBundle> ourBundle;
public class AnalysisScopeBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.AnalysisScopeBundle";
private static final AnalysisScopeBundle INSTANCE = new AnalysisScopeBundle();
private AnalysisScopeBundle() {
}
private AnalysisScopeBundle() { super(BUNDLE); }
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
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;
}
}
}
@@ -15,36 +15,19 @@
*/
package com.intellij.codeInsight.daemon;
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;
/**
* @author max
*/
public class DaemonBundle {
private static Reference<ResourceBundle> ourBundle;
public class DaemonBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.DaemonBundle";
private static final DaemonBundle INSTANCE = new DaemonBundle();
private DaemonBundle() {
}
private DaemonBundle() { super(BUNDLE); }
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE)String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
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;
}
}
}
@@ -1,34 +1,19 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection;
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 CommonQuickFixBundle extends DynamicBundle {
@NonNls public static final String BUNDLE = "messages.CommonQuickFixBundle";
private static final CommonQuickFixBundle INSTANCE = new CommonQuickFixBundle();
/**
* This bundle contains messages for quick-fixes and intention actions which can be reused across languages.
*/
public class CommonQuickFixBundle {
private static Reference<ResourceBundle> ourBundle;
public static final String BUNDLE = "messages.CommonQuickFixBundle";
private CommonQuickFixBundle() { }
private CommonQuickFixBundle() { super(BUNDLE); }
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
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);
}
}
@@ -15,34 +15,19 @@
*/
package com.intellij.codeInspection;
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 InspectionsBundle extends DynamicBundle {
@NonNls public static final String BUNDLE = "messages.InspectionsBundle";
private static final InspectionsBundle INSTANCE = new InspectionsBundle();
/**
* @author max
*/
public class InspectionsBundle {
private static Reference<ResourceBundle> ourBundle;
public static final String BUNDLE = "messages.InspectionsBundle";
private InspectionsBundle() { }
private InspectionsBundle() { super(BUNDLE); }
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
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);
}
}
@@ -15,36 +15,19 @@
*/
package com.intellij.codeInsight;
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;
/**
* @author max
*/
public class CodeInsightBundle {
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
private static Reference<ResourceBundle> ourBundle;
public class CodeInsightBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.CodeInsightBundle";
private static final CodeInsightBundle INSTANCE = new CodeInsightBundle();
private CodeInsightBundle() {
}
private CodeInsightBundle() { super(BUNDLE); }
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;
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
}
}
@@ -15,36 +15,19 @@
*/
package com.intellij.openapi.editor;
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 EditorBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.EditorBundle";
private static final EditorBundle INSTANCE = new EditorBundle();
/**
* @author lesya
*/
public class EditorBundle {
private EditorBundle() { super(BUNDLE); }
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls protected static final String PATH_TO_BUNDLE = "messages.EditorBundle";
private EditorBundle() {
}
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(PATH_TO_BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
}
}
}
@@ -15,42 +15,24 @@
*/
package com.intellij.psi;
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 PsiBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.PsiBundle";
private static final PsiBundle INSTANCE = new PsiBundle();
/**
* @author max
*/
public class PsiBundle {
private PsiBundle() { super(BUNDLE); }
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
return INSTANCE.getMessage(key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls private static final String BUNDLE = "messages.PsiBundle";
private PsiBundle() {
}
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;
}
@NotNull
public static String visibilityPresentation(@NotNull String modifier) {
return message(modifier + ".visibility.presentation");
}
}
}
@@ -15,41 +15,24 @@
*/
package com.intellij.dvcs.ui;
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 DvcsBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "com.intellij.dvcs.ui.DvcsBundle";
private static final DvcsBundle INSTANCE = new DvcsBundle();
/**
* @author Nadya Zabrodina
*/
public class DvcsBundle {
private DvcsBundle() { super(BUNDLE); }
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
return INSTANCE.getMessage(key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls
private static final String BUNDLE = "com.intellij.dvcs.ui.DvcsBundle";
private DvcsBundle() {
}
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;
}
public static String getString(@PropertyKey(resourceBundle = BUNDLE) final String key) {
return getBundle().getString(key);
@NotNull
public static String getString(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key) {
return message(key);
}
}
@@ -15,36 +15,20 @@
*/
package com.intellij.openapi.diff;
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 DiffBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.DiffBundle";
/**
* @author lesya
*/
public class DiffBundle {
private static final DiffBundle INSTANCE = new DiffBundle();
public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
private DiffBundle() { super(BUNDLE); }
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls protected static final String PATH_TO_BUNDLE = "messages.DiffBundle";
private DiffBundle() {
}
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(PATH_TO_BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
}
}
}
@@ -16,34 +16,19 @@
package com.intellij.openapi.keymap;
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 KeyMapBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.KeyMapBundle";
private static final KeyMapBundle INSTANCE = new KeyMapBundle();
public class KeyMapBundle {
private KeyMapBundle() { super(BUNDLE); }
public static String message(@NotNull @PropertyKey(resourceBundle = "messages.KeyMapBundle") String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
private static Reference<ResourceBundle> ourBundle;
@NonNls
protected static final String PATH_TO_BUNDLE = "messages.KeyMapBundle";
private KeyMapBundle() {
}
private static ResourceBundle getBundle() {
ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
if (bundle == null) {
bundle = ResourceBundle.getBundle(PATH_TO_BUNDLE);
ourBundle = new SoftReference<>(bundle);
}
return bundle;
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
}
@@ -16,35 +16,19 @@
package com.intellij.xdebugger;
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;
/**
* @author nik
*/
public class XDebuggerBundle {
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return CommonBundle.message(getBundle(), key, params);
}
public class XDebuggerBundle extends DynamicBundle {
@NonNls private static final String BUNDLE = "messages.XDebuggerBundle";
private static Reference<ResourceBundle> ourBundle;
private static final XDebuggerBundle INSTANCE = new XDebuggerBundle();
private XDebuggerBundle() {
}
private XDebuggerBundle() { super(BUNDLE); }
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;
@NotNull
public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, @NotNull Object... params) {
return INSTANCE.getMessage(key, params);
}
}
}