T - type of callbackpublic final class CallbackPropertyHandler<T> extends Object
| Constructor and Description |
|---|
CallbackPropertyHandler(Key property)
Creates the object storing the property key to manage.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getCallback(NativeObjectContainer container)
Returns the callback stored in the native object or
null if not exists. |
T |
getCallback(NativeObjectContainer container,
T defaultValue)
Returns the callback stored in the native object or the default value passed as argument, if not exists.
|
Key |
getHashCodeProperty()
Returns the property key used to store the class name plus hash code, as key of callback instance in the cache.
|
Key |
getProperty()
Returns the property key to manage
|
boolean |
removeChartScope(String scope)
Called by
CallbackPropertyManager when a chart is destroy in order to remove the scope (and then teh callback if needed) from cache. |
void |
setCallback(AbstractNode container,
String scope,
T callback,
CallbackProxy.Proxy proxy)
Stores the callback in the the cache, storing the proxy function and the hash code property key (unique id of callback) in the native object.
|
public CallbackPropertyHandler(Key property)
property - the property key to managepublic Key getProperty()
public Key getHashCodeProperty()
public void setCallback(AbstractNode container, String scope, T callback, CallbackProxy.Proxy proxy)
container - container instance of native object to use to store the propertiesscope - the scope of callback, could be the default, chart type options, chart options, plugin objects, data setscallback - the java callback instance to cacheproxy - the proxy java script function to store in the native objectpublic T getCallback(NativeObjectContainer container)
null if not exists.container - container instance of native object to use to get the unique key to retrieve the callback from cachenull if not existspublic T getCallback(NativeObjectContainer container, T defaultValue)
container - container instance of native object to use to get the unique key to retrieve the callback from cachedefaultValue - default value to return if the callback does not existpublic boolean removeChartScope(String scope)
CallbackPropertyManager when a chart is destroy in order to remove the scope (and then teh callback if needed) from cache.scope - the scope of the callback, is chart idtrue if this callback handler has got 1 or more scope related to charts.