// Copyright 2000-2019 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.ide;

import com.intellij.BundleBase;
import com.intellij.DynamicBundle;
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.util.NullableLazyValue;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.Nls;

import java.util.ResourceBundle;

/**
 * @author yole
 */
public class TypeNameEP extends AbstractExtensionPointBean {
  public static final ExtensionPointName<TypeNameEP> EP_NAME = ExtensionPointName.create("com.intellij.typeName");

  @Attribute("className")
  public String className;

  @Attribute("name")
  @Nls(capitalization = Nls.Capitalization.Title)
  public String name;

  @Attribute("resourceBundle")
  public String resourceBundle;

  @Attribute("resourceKey")
  @Nls(capitalization = Nls.Capitalization.Title)
  public String resourceKey;

  private final NullableLazyValue<String> myName = new NullableLazyValue<String>() {
    @Override
    protected String compute() {
      if (name != null) {
        return name;
      }
      if (resourceKey != null) {
        String bundleName = resourceBundle;
        if (bundleName == null && myPluginDescriptor != null) {
          bundleName = myPluginDescriptor.getResourceBundleBaseName();
        }
        if (bundleName != null) {
          ResourceBundle bundle = DynamicBundle.INSTANCE.getResourceBundle(bundleName, getLoaderForClass());
          return BundleBase.message(bundle, resourceKey);
        }
      }
      return null;
    }
  };

  public NullableLazyValue<String> getTypeName() {
    return myName;
  }
}

@@ -17,10 +17,10 @@
 0-20
-19
+20
  Jet
@@ -354,16 +354,72 @@
 ntName;%0A
+import com.intellij.openapi.extensions.RequiredElement;%0A
 import c
@@ -789,16 +789,16 @@
 ame%22);%0A%0A
-
   @Attri
@@ -811,24 +811,43 @@
 className%22)%0A
+  @RequiredElement%0A
   public Str

mark className as required