All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.android.AndroidCommonBundle Maven / Gradle / Ivy

package org.jetbrains.android;

import com.intellij.CommonBundle;
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 Eugene.Kudelevsky
 */
public class AndroidCommonBundle {
  @NonNls private static final String BUNDLE_NAME = "messages.AndroidCommonBundle";
  private static Reference ourBundle;

  private static ResourceBundle getBundle() {
    ResourceBundle bundle = com.intellij.reference.SoftReference.dereference(ourBundle);
    if (bundle == null) {
      bundle = ResourceBundle.getBundle(BUNDLE_NAME);
      ourBundle = new SoftReference(bundle);
    }
    return bundle;
  }

  private AndroidCommonBundle() {
  }

  public static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) {
    return CommonBundle.message(getBundle(), key, params);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy