public class Plugins extends Object
Modifier and Type | Method and Description |
---|---|
List<Key> |
getAllIds()
Returns the unmodifiable list of registered plugin ids.
|
<T extends AbstractPluginOptions> |
getOptions(AbstractPluginOptionsFactory<T> factory)
Returns the plugin options, if exist.
It uses a factory instance to create a plugin options. If factory argument is not consistent, null is returned. |
<T extends AbstractPluginOptions> |
getOptions(String pluginId,
AbstractPluginOptionsFactory<T> factory)
Returns the plugin options, if exist.
It uses a factory instance to create a plugin options. |
<T extends AbstractPluginOptions> |
getOptionsAsList(AbstractPluginOptionsFactory<T> factory)
Returns the plugin options as list, if exist.
It uses a factory instance to create a plugin options. |
<T extends AbstractPluginOptions> |
getOptionsAsList(String pluginId,
AbstractPluginOptionsFactory<T> factory)
Returns the plugin options as list, if exist.
It uses a factory instance to create a plugin options. |
ObjectType |
getOptionsType(String pluginId)
Returns the options type.
|
boolean |
hasEnabled(String pluginId)
Returns if a global plugin has been set or not.
|
boolean |
hasOptions(String pluginId)
Checks if there is any options for a specific plugin, by its id.
|
boolean |
isEnabled(String pluginId)
Returns if a global plugin is enabled or not.
|
boolean |
isForcedlyDisabled(DefaultPlugin plugin)
Returns if a default CHART.JS plugin is enabled or not, forced directly by global plugin manager
|
boolean |
isForcedlyDisabled(String pluginId)
Returns if a global plugin is enabled or not, forced directly by global plugin manager
|
void |
removeOptions(String pluginId)
Removes the plugin options.
|
void |
setEnabled(DefaultPlugin plugin,
boolean enabled)
Sets if a default CHART.JS plugin must be enabled or not.
|
void |
setEnabled(String pluginId,
boolean enabled)
Sets if a global plugin must be enabled or not.
|
<T extends AbstractPluginOptions> |
setOptions(List<T> options)
Sets the plugin options as list.
If the list is empty, it does nothing |
<T extends AbstractPluginOptions> |
setOptions(String pluginId,
List<T> options)
Sets the plugin options as list.
If passed options is null, the configuration of plugin will be removed. |
<T extends AbstractPluginOptions> |
setOptions(String pluginId,
T options)
Sets the plugin options.
If passed options is null, the configuration of plugin will be removed. |
<T extends AbstractPluginOptions> |
setOptions(T options)
Sets the plugin options.
|
public final List<Key> getAllIds()
public void setEnabled(String pluginId, boolean enabled)
pluginId
- plugin id.enabled
- false
disable a global plugin.public void setEnabled(DefaultPlugin plugin, boolean enabled)
plugin
- default CHART.JS plugin instance.enabled
- false
disable a default CHART.JS plugin.public boolean isEnabled(String pluginId)
pluginId
- plugin id.false
if a global plugin is not enabled otherwise true
.public boolean isForcedlyDisabled(String pluginId)
pluginId
- plugin id.true
if a global plugin is not enabled otherwise false
.public boolean isForcedlyDisabled(DefaultPlugin plugin)
plugin
- a default CHART.JS plugin.true
if a default CHART.JS plugin is not enabled otherwise false
.public boolean hasEnabled(String pluginId)
pluginId
- plugin id.false
if a global plugin has not been set otherwise true
.public void removeOptions(String pluginId)
pluginId
- plugin id.public <T extends AbstractPluginOptions> void setOptions(T options)
T
- type of plugin options to storeoptions
- plugin options used to configure the pluginpublic <T extends AbstractPluginOptions> void setOptions(List<T> options)
T
- type of plugin options to storeoptions
- list of plugin options used to configure the plugin.public <T extends AbstractPluginOptions> void setOptions(String pluginId, T options)
T
- type of plugin options to storepluginId
- plugin id.options
- plugin options used to configure the plugin.null
to remove the configuration if exist.public <T extends AbstractPluginOptions> void setOptions(String pluginId, List<T> options)
T
- type of pugin options to storepluginId
- plugin id.options
- list of plugin options used to configure the plugin.null
to remove the configuration if exist.public boolean hasOptions(String pluginId)
pluginId
- plugin id.true
if there is an options, otherwise false
.public ObjectType getOptionsType(String pluginId)
pluginId
- plugin id.public <T extends AbstractPluginOptions> T getOptions(AbstractPluginOptionsFactory<T> factory)
null
is returned.T
- type of plugin options to returnfactory
- factory instance to create a plugin optionsnull
is returned.public <T extends AbstractPluginOptions> T getOptions(String pluginId, AbstractPluginOptionsFactory<T> factory)
T
- type of plugin options to returnpluginId
- plugin id.factory
- factory instance to create a plugin optionspublic <T extends AbstractPluginOptions> List<T> getOptionsAsList(AbstractPluginOptionsFactory<T> factory)
T
- type of plugin options to returnfactory
- factory instance to create a plugin options.public <T extends AbstractPluginOptions> List<T> getOptionsAsList(String pluginId, AbstractPluginOptionsFactory<T> factory)
T
- type of plugin options to returnpluginId
- plugin id.factory
- factory instance to create a plugin options.