Package hudson.plugins.locale
Class PluginImpl
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
hudson.plugins.locale.PluginImpl
- All Implemented Interfaces:
ExtensionPoint,Describable<GlobalConfiguration>,Saveable,Loadable,OnMaster
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsFields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject jsonObject) Retrieves a ListBoxModel containing the available system locales.static PluginImplget()protected XmlFilestatic voidinit()booleanbooleanvoidload()static LocaleParses a string like "ja_JP" into aLocaleobject.voidsetAllowUserPreferences(boolean allowUserPreferences) Sets whether the plugin should take user preferences into account.voidsetIgnoreAcceptLanguage(boolean ignoreAcceptLanguage) Sets whether the plugin should take user preferences into account.voidsetSystemLocale(String systemLocale) Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Field Details
-
USE_BROWSER_LOCALE
- See Also:
-
ALLOWED_LOCALES
-
-
Constructor Details
-
PluginImpl
public PluginImpl()
-
-
Method Details
-
get
-
getConfigFile
- Overrides:
getConfigFilein classDescriptor<GlobalConfiguration>
-
init
- Throws:
Exception
-
load
public void load()- Specified by:
loadin interfaceLoadable- Overrides:
loadin classDescriptor<GlobalConfiguration>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject jsonObject) - Overrides:
configurein classGlobalConfiguration
-
isIgnoreAcceptLanguage
public boolean isIgnoreAcceptLanguage() -
isAllowUserPreferences
public boolean isAllowUserPreferences() -
getSystemLocale
-
setSystemLocale
-
setIgnoreAcceptLanguage
public void setIgnoreAcceptLanguage(boolean ignoreAcceptLanguage) Sets whether the plugin should take user preferences into account.- Parameters:
ignoreAcceptLanguage- Iftrue, ignore browser preference and force this language to all users- Since:
- 1.3
-
setAllowUserPreferences
public void setAllowUserPreferences(boolean allowUserPreferences) Sets whether the plugin should take user preferences into account.- Parameters:
allowUserPreferences- Iftrue, ignore browser preference and use the language a user configured
-
parse
Parses a string like "ja_JP" into aLocaleobject.- Parameters:
s- the locale string using underscores as delimiters- Returns:
- the Locale object
-
getCategory
- Overrides:
getCategoryin classDescriptor<GlobalConfiguration>
-
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.
-