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 Summary
Constructors Constructor Description GlobalPlugins()Builds the object by the native object which mapschart.registry.plugins
-
Method Summary
All 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.
-
-
-
Method Detail
-
register
public 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, otherwisefalseif the plugin is already registered with the plugin id of plugin instance.
-
register
public boolean register(Plugin plugin)
Registers a plugin as global, to apply to all charts.- Parameters:
plugin- plugin instance- Returns:
trueif registered, otherwisefalseif the plugin is already registered with the plugin id of plugin instance.
-
register
public 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, otherwisefalseif the plugin is already registered with the plugin id of plugin instance.
-
register
public boolean register(SmartPlugin plugin)
Registers a plugin as global, to apply to all charts.- Parameters:
plugin- plugin instance- Returns:
trueif registered, otherwisefalseif the plugin is already registered with the plugin id of plugin instance.
-
unregister
public 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, otherwisefalseif the plugin is not a custom one.
-
getIds
public Set<String> getIds()
Gets all global registered plugins ids.- Returns:
- all global registered plugins ids.
-
setEnabledAllCharts
public 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 enableenable-trueto enable to all charts, otherwisefalse.
-
isEnabledAllCharts
public 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, otherwisefalse.
-
onChartConfigure
public 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
-
-