public final class Plugins extends NativeObjectContainer
Modifier and Type | Method and Description |
---|---|
protected void |
checkAndAddToParent()
Called recursively when a property has been set in the item.
This is mandatory because it could happen that the parent item is not present, therefore it must be added. |
protected Key |
getChildKey()
Returns the property name to use to add this element to its parent.
|
protected D |
getDefaultValues()
Returns the default provider instance.
|
<T extends NativeObjectContainer> |
getOptions(String pluginId,
NativeObjectContainerFactory<T> factory)
Returns the plugin options, if exist.
|
<T extends NativeObjectContainer> |
getOptionsAsList(String pluginId,
NativeObjectContainerFactory<T> factory)
Returns the plugin options as list of object containers, if exist.
|
ObjectType |
getOptionsType(String pluginId)
Returns the options type.
|
protected P |
getParent()
Returns the parent element.
|
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.
|
protected void |
setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for callbacks) to a model at the specific key.
|
void |
setEnabled(String pluginId,
boolean enabled)
Sets if a global plugin must be enabled or not.
|
protected void |
setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for events) to a model at the specific key.
|
<T extends NativeObjectContainer> |
setOptions(String pluginId,
List<T> options)
Sets the plugin options as array.
|
<T extends NativeObjectContainer> |
setOptions(String pluginId,
T options)
Sets the plugin options.
|
checkValue, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public void setEnabled(String pluginId, boolean enabled)
pluginId
- plugin id.enabled
- false
disable a global plugin.public boolean isEnabled(String pluginId)
pluginId
- plugin id.false
if a global 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 <T extends NativeObjectContainer> void setOptions(String pluginId, T options)
T
- type of native object container to storepluginId
- plugin id.options
- java script object used to configure the plugin. Pass null
to remove the configuration if
exist.public <T extends NativeObjectContainer> void setOptions(String pluginId, List<T> options)
T
- type of native object container to storepluginId
- plugin id.options
- list of native object container used to configure the plugin. Pass 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 NativeObjectContainer> T getOptions(String pluginId, NativeObjectContainerFactory<T> factory)
null
is returned.T
- type of native object container to returnpluginId
- plugin id.factory
- factory instance to create a native object container.null
is returned.public <T extends NativeObjectContainer> List<T> getOptionsAsList(String pluginId, NativeObjectContainerFactory<T> factory)
T
- type of native object container to returnpluginId
- plugin id.factory
- factory instance to create a native object container.protected final Key getChildKey()
null
if is a root element.protected final P getParent()
null
if is a root element.protected final D getDefaultValues()
protected final void setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void checkAndAddToParent()