Class DefaultChartPlugins
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartPlugins
-
- All Implemented Interfaces:
IsDefaultPlugins
public final class DefaultChartPlugins extends Object implements IsDefaultPlugins
Defaults for plugins options, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DefaultChartPlugins(IsDefaultPlugins plugins)
Creates the object by plugins option element instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends AbstractPluginOptions>
TgetOptions(String pluginId, AbstractPluginOptionsFactory<T> factory)
Returns the plugin options, if exist.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.
-
-
-
Constructor Detail
-
DefaultChartPlugins
public DefaultChartPlugins(IsDefaultPlugins plugins)
Creates the object by plugins option element instance.- Parameters:
plugins
- plugins option element instance.
-
-
Method Detail
-
isEnabled
public boolean isEnabled(String pluginId)
Description copied from interface:IsDefaultPlugins
Returns if a global plugin is enabled or not.- Specified by:
isEnabled
in interfaceIsDefaultPlugins
- Parameters:
pluginId
- plugin id.- Returns:
false
if a global plugin is not enabled otherwisetrue
.
-
hasOptions
public boolean hasOptions(String pluginId)
Description copied from interface:IsDefaultPlugins
Checks if there is any options for a specific plugin, by its id.- Specified by:
hasOptions
in interfaceIsDefaultPlugins
- Parameters:
pluginId
- plugin id.- Returns:
true
if there is an options, otherwisefalse
.
-
getOptions
public <T extends AbstractPluginOptions> T getOptions(String pluginId, AbstractPluginOptionsFactory<T> factory)
Description copied from interface:IsDefaultPlugins
Returns the plugin options, if exist. It uses a factory instance to create a native object container.
If factory argument is not consistent,null
is returned.- Specified by:
getOptions
in interfaceIsDefaultPlugins
- Type Parameters:
T
- type of native object container to return- Parameters:
pluginId
- plugin id.factory
- factory instance to create a native object container.- Returns:
- java script object used to configure the plugin or an empty object if not exist. If factory argument is not consistent,
null
is returned.
-
-