Class AbstractPluginOptionsFactory<T extends AbstractPluginOptions>
- java.lang.Object
-
- org.pepstock.charba.client.plugins.AbstractPluginOptionsFactory<T>
-
- Direct Known Subclasses:
AnnotationOptionsFactory
,ChartBackgroundColorOptionsFactory
,ChartPointerOptionsFactory
,ColorSchemesOptionsFactory
,DataLabelsOptionsFactory
,DatasetsItemsSelectorOptionsFactory
,HtmlLegendOptionsFactory
,LabelsOptionsFactory
,ZoomOptionsFactory
public abstract class AbstractPluginOptionsFactory<T extends AbstractPluginOptions> extends Object
Factory to get the plugin options (form chart, from datasets or from default global ones) related to the plugin.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPluginOptionsFactory(String pluginId)
Creates the object with plugin ID.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract T
create(NativeObject nativeObject, IsDefaultPlugins defaultValues)
Creates a plugin options by a native object which is containing the options values and its defaults.String
getPluginId()
Returns the plugin id related to this options.protected <G extends AbstractPluginOptions>
GloadDefaultsPluginOptions(IsDefaultPlugins defaultsPlugins, AbstractPluginOptionsFactory<G> factory)
Loads the default plugin options from defaults.
If factory, passed as argument, isnull
, returnsnull
.
-
-
-
Constructor Detail
-
AbstractPluginOptionsFactory
protected AbstractPluginOptionsFactory(String pluginId)
Creates the object with plugin ID.- Parameters:
pluginId
- plugin id
-
-
Method Detail
-
getPluginId
public final String getPluginId()
Returns the plugin id related to this options.- Returns:
- the plugin id related to this options
-
create
public abstract T create(NativeObject nativeObject, IsDefaultPlugins defaultValues)
Creates a plugin options by a native object which is containing the options values and its defaults.- Parameters:
nativeObject
- native object which is containing the optionsdefaultValues
- the defaults values for the plugin options- Returns:
- a plugin options instance
-
loadDefaultsPluginOptions
protected final <G extends AbstractPluginOptions> G loadDefaultsPluginOptions(IsDefaultPlugins defaultsPlugins, AbstractPluginOptionsFactory<G> factory)
Loads the default plugin options from defaults.
If factory, passed as argument, isnull
, returnsnull
.- Type Parameters:
G
- type of native object container- Parameters:
defaultsPlugins
- default values to use to load the plugin optionsfactory
- factory to load options- Returns:
- the defaults plugin options or new options instance if not exist. If factory is
null
, returnsnull
.
-
-