public class Plugins extends Object
Modifier and Type | Method and Description |
---|---|
List<Key> |
getAllIds()
Returns the unmodifiable list of registered plugin ids.
|
IsChart |
getChart()
Returns the chart instance
|
protected ExtendedOptions |
getConfiguration()
Returns the configuration element.
|
protected ConfigurationOptions |
getOptions()
Returns the configuration options.
|
<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. |
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(DefaultPluginId pluginId)
Returns if a default plugin is enabled or not.
|
boolean |
isEnabled(String pluginId)
Returns if a plugin is enabled or not.
|
void |
removeOptions(String pluginId)
Removes the plugin options.
|
void |
setEnabled(DefaultPluginId plugin,
boolean enabled)
Sets if a default plugin must be enabled or not.
|
void |
setEnabled(String pluginId,
boolean enabled)
Sets if a plugin must be enabled or not.
|
<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 plugin.public void setEnabled(DefaultPluginId plugin, boolean enabled)
plugin
- default plugin instance.enabled
- false
disable a default plugin.public boolean isEnabled(String pluginId)
pluginId
- plugin id.false
if a plugin is not enabled otherwise true
.public boolean isEnabled(DefaultPluginId pluginId)
pluginId
- default plugin id.false
if a default plugin is not enabled otherwise true
.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(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 boolean hasOptions(String pluginId)
pluginId
- plugin id.true
if there is an options, otherwise false
.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 optionsprotected final ConfigurationOptions getOptions()
protected final ExtendedOptions getConfiguration()
public final IsChart getChart()