Class PluginImpl

All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, Saveable, Loadable, OnMaster

@Extension @Symbol("locale") public class PluginImpl extends GlobalConfiguration
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • PluginImpl

      public PluginImpl()
  • Method Details

    • get

      public static PluginImpl get()
    • getConfigFile

      protected XmlFile getConfigFile()
      Overrides:
      getConfigFile in class Descriptor<GlobalConfiguration>
    • init

      @Initializer(after=EXTENSIONS_AUGMENTED) public static void init() throws Exception
      Throws:
      Exception
    • load

      public void load()
      Specified by:
      load in interface Loadable
      Overrides:
      load in class Descriptor<GlobalConfiguration>
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject jsonObject) throws Descriptor.FormException
      Overrides:
      configure in class GlobalConfiguration
      Throws:
      Descriptor.FormException
    • isIgnoreAcceptLanguage

      public boolean isIgnoreAcceptLanguage()
    • getSystemLocale

      public String getSystemLocale()
    • setSystemLocale

      public void setSystemLocale(String systemLocale)
    • getUseBrowserLocale

      public String getUseBrowserLocale()
    • setIgnoreAcceptLanguage

      public void setIgnoreAcceptLanguage(boolean ignoreAcceptLanguage)
      Sets whether the plugin should take user preferences into account.
      Parameters:
      ignoreAcceptLanguage - If true, Ignore browser preference and force this language to all users
      Since:
      1.3
    • parse

      public static Locale parse(String s)
      Parses a string like "ja_JP" into a Locale object.
      Parameters:
      s - the locale string using underscores as delimiters
      Returns:
      the Locale object
    • getCategory

      @NonNull public GlobalConfigurationCategory getCategory()
      Overrides:
      getCategory in class Descriptor<GlobalConfiguration>
    • doFillSystemLocaleItems

      public ListBoxModel doFillSystemLocaleItems()
      Retrieves a ListBoxModel containing the available system locales. This method populates a ListBoxModel with the available system locales, sorted lexicographically by their string representations. Each locale's display name and string representation are added as options to the model.
      Returns:
      A ListBoxModel containing the available system locales.