Class AbstractPluginOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.plugins.AbstractPluginOptions
-
- All Implemented Interfaces:
IsDefaultEventHandler
,HasEvents
- Direct Known Subclasses:
AnnotationOptions
,ChartBackgroundColorOptions
,ChartPointerOptions
,ColorSchemesOptions
,CrosshairOptions
,DatasetsItemsSelectorOptions
,GradientOptions
,HtmlLegendOptions
,LabelItem
,LabelsOptions
,ZoomOptions
public abstract class AbstractPluginOptions extends AbstractNode implements HasEvents
Abstract plugin options where to set all the configuration needed to the plugin.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractPluginOptions.Property
Name of properties of native object.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPluginOptions(String pluginId, AbstractNode parent, Key childKey, NativeObject nativeObject, boolean createUniqueId)
Creates the object with the parent, the key of this element, default values and native object to map java script properties.protected
AbstractPluginOptions(String pluginId, NativeObject nativeObject)
Creates new plugin options with plugin ID, using a native object instance.protected
AbstractPluginOptions(String pluginId, NativeObject nativeObject, boolean createUniqueId)
Creates new plugin options with plugin ID, using a native object instance and setting if a unique id must calculated
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyingDefaults()
This is invoked before storing the plugins options as default.void
applyingDefaults(ChartEnvelop<String> envelop)
This is invoked before storing the plugins options as default.
This is called set the options of plugin are stored as default, seeGlobalOptions.getPlugins()
.EventsOptionHandler
getEventsOptionHandler()
Returns a event handler handler instance to use in the default methods of this interface.String
getId()
Returns the unique ID of the options.String
getPluginId()
Returns the plugin id related to this options.protected <T extends AbstractPluginOptions>
TloadGlobalsPluginOptions(AbstractPluginOptionsFactory<T> factory)
Loads the default plugin options from defaults.void
store()
Stores this options in the default global plugins options.void
store(Dataset dataset)
Stores this options in the dataset options.void
store(IsChart chart)
Stores this options in the chart plugins options.void
store(Type type)
Stores this options in the global chart plugins options.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
AbstractPluginOptions
protected AbstractPluginOptions(String pluginId, NativeObject nativeObject)
Creates new plugin options with plugin ID, using a native object instance.- Parameters:
pluginId
- plugin IDnativeObject
- native object which represents the plugin options as native object
-
AbstractPluginOptions
protected AbstractPluginOptions(String pluginId, NativeObject nativeObject, boolean createUniqueId)
Creates new plugin options with plugin ID, using a native object instance and setting if a unique id must calculated- Parameters:
pluginId
- plugin IDnativeObject
- native object which represents the plugin options as native objectcreateUniqueId
- iftrue
, a unique id will be created and stored in the object.
-
AbstractPluginOptions
protected AbstractPluginOptions(String pluginId, AbstractNode parent, Key childKey, NativeObject nativeObject, boolean createUniqueId)
Creates the object with the parent, the key of this element, default values and native object to map java script properties.- Parameters:
pluginId
- plugin IDparent
- parent node to use to add this element where changedchildKey
- the property name of this element to use to add it to the parent.nativeObject
- native object to map java script propertiescreateUniqueId
- iftrue
, a unique id will be created and stored in the object.
-
-
Method Detail
-
getEventsOptionHandler
public final EventsOptionHandler getEventsOptionHandler()
Description copied from interface:HasEvents
Returns a event handler handler instance to use in the default methods of this interface.- Specified by:
getEventsOptionHandler
in interfaceHasEvents
- Returns:
- a event handler handler instance
-
getId
public final String getId()
Returns the unique ID of the options.- Returns:
- the unique ID of the options.
-
getPluginId
public final String getPluginId()
Returns the plugin id related to this options.- Returns:
- the plugin id related to this options
-
loadGlobalsPluginOptions
protected final <T extends AbstractPluginOptions> T loadGlobalsPluginOptions(AbstractPluginOptionsFactory<T> factory)
Loads the default plugin options from defaults. If factory, passed as argument, isnull
, returnsnull
.- Type Parameters:
T
- type of native object container- Parameters:
factory
- factory to load options- Returns:
- the defaults plugin options or new options instance if not exist. If factory is
null
, returnsnull
.
-
applyingDefaults
public final void applyingDefaults(ChartEnvelop<String> envelop)
This is invoked before storing the plugins options as default.
This is called set the options of plugin are stored as default, seeGlobalOptions.getPlugins()
.- Parameters:
envelop
- envelop needed to ensure that this public method can be called only byGlobalOptions
-
applyingDefaults
protected void applyingDefaults()
This is invoked before storing the plugins options as default.
-
store
public final void store()
Stores this options in the default global plugins options.
-
store
public final void store(IsChart chart)
Stores this options in the chart plugins options.- Parameters:
chart
- chart instance
-
store
public final void store(Type type)
Stores this options in the global chart plugins options.- Parameters:
type
- chart type to store options in the global chart options
-
store
public final void store(Dataset dataset)
Stores this options in the dataset options.- Parameters:
dataset
- dataset instance to store options
-
-