Class GlobalPlugins
- java.lang.Object
- 
- org.pepstock.charba.client.plugins.GlobalPlugins
 
- 
 public final class GlobalPlugins extends Object Global configuration to set plugins at global level.
 It maps the CHART.JS object of default,chart.plugins.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Constructor SummaryConstructors Constructor Description GlobalPlugins(ChartEnvelop<NativeObject> envelop)Builds the object by the native object which mapschart.registry.plugins
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getIds()Gets all global registered plugins ids.booleanisEnabledAllCharts(String pluginId)Returnstrueif the plugin is enabled to all charts, otherwisefalse.voidonChartConfigure(Configuration config, IsChart chart)Invokes the on configuration method to inform the plugins that the chart is going to be initialized.booleanregister(Plugin plugin)Registers a plugin as global, to apply to all charts.booleanregister(PluginContainer container)Registers a plugin as global, to apply to all charts, by a containerbooleanregister(SmartPlugin plugin)Registers a plugin as global, to apply to all charts.booleanregister(SmartPluginContainer container)Registers a plugin as global, to apply to all charts, by a containervoidsetEnabledAllCharts(String pluginId, boolean enable)Settingfalsefor plugin id, the global plugin is disable to all charts and to activate the plugin on a specific chart, is it enough to enable the plugin by options.booleanunregister(String pluginId)Unregisters a global plugin.
 
- 
- 
- 
Constructor Detail- 
GlobalPluginspublic GlobalPlugins(ChartEnvelop<NativeObject> envelop) Builds the object by the native object which mapschart.registry.plugins- Parameters:
- envelop- envelop from root package to avoid invocation
 
 
- 
 - 
Method Detail- 
registerpublic boolean register(PluginContainer container) Registers a plugin as global, to apply to all charts, by a container- Parameters:
- container- plugin container instance
- Returns:
- trueif registered, otherwise- falseif the plugin is already registered with the plugin id of plugin instance.
 
 - 
registerpublic boolean register(Plugin plugin) Registers a plugin as global, to apply to all charts.- Parameters:
- plugin- plugin instance
- Returns:
- trueif registered, otherwise- falseif the plugin is already registered with the plugin id of plugin instance.
 
 - 
registerpublic boolean register(SmartPluginContainer container) Registers a plugin as global, to apply to all charts, by a container- Parameters:
- container- plugin container instance
- Returns:
- trueif registered, otherwise- falseif the plugin is already registered with the plugin id of plugin instance.
 
 - 
registerpublic boolean register(SmartPlugin plugin) Registers a plugin as global, to apply to all charts.- Parameters:
- plugin- plugin instance
- Returns:
- trueif registered, otherwise- falseif the plugin is already registered with the plugin id of plugin instance.
 
 - 
unregisterpublic boolean unregister(String pluginId) Unregisters a global plugin. This is possible ONLY for plugins added as custom ones.- Parameters:
- pluginId- plugin instance
- Returns:
- trueif unregistered, otherwise- falseif the plugin is not a custom one.
 
 - 
getIdspublic Set<String> getIds() Gets all global registered plugins ids.- Returns:
- all global registered plugins ids.
 
 - 
setEnabledAllChartspublic void setEnabledAllCharts(String pluginId, boolean enable) Settingfalsefor plugin id, the global plugin is disable to all charts and to activate the plugin on a specific chart, is it enough to enable the plugin by options.- Parameters:
- pluginId- plug id to enable
- enable-- trueto enable to all charts, otherwise- false.
 
 - 
isEnabledAllChartspublic boolean isEnabledAllCharts(String pluginId) Returnstrueif the plugin is enabled to all charts, otherwisefalse.- Parameters:
- pluginId- plug id to check
- Returns:
- trueif the plugin is enabled to all charts, otherwise- false.
 
 - 
onChartConfigurepublic void onChartConfigure(Configuration config, IsChart chart) Invokes the on configuration method to inform the plugins that the chart is going to be initialized.- Parameters:
- config- configuration item. Added only to reduce visibility of public method.
- chart- instance of the chart
 
 
- 
 
-