public static class IlvSDMCSSFunction.SymbolInteractor extends IlvSDMCSSFunction
The handler is able to call an ActionListener when interaction is performed.
The function has 2 optional parameters. The first one is the name of a model attribute which will hold the interaction values, read and write. The second parameter is the initial value, in case the model attribute doesn't yet exist.
If the first parameter is not specified, then an internal variable is used (actually: a property on the graphic object). Then the model is left unaffected by interactions.
IlvSDMCSSFunction.Feedback, IlvSDMCSSFunction.NumericSymbolInteractor, IlvSDMCSSFunction.StateSymbolInteractor, IlvSDMCSSFunction.SymbolInteractor, IlvSDMCSSFunction.Test
Modifier and Type | Field and Description |
---|---|
protected Object |
_initialValue
Initial default value, type String.
|
ANY, ANY_PROPERTIES, ANY_PSEUDOCLASSES
Constructor and Description |
---|
SymbolInteractor()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener l)
Registers a listener.
|
Object |
call(Object[] args,
Class<?> type,
IlvSDMEngine engine,
Object node,
Object target)
Calls the function.
|
String |
getName()
Returns the name of the function that will be known in the
style sheet.
|
String |
getShortDescription()
Returns a short description of the function.
|
IlvSDMCSSFunction.Feedback[] |
invert(Object[] args,
Object value,
IlvSDMEngine engine,
Object node)
This method is called from the style sheet renderer to
update a model object property.
|
void |
removeActionListener(ActionListener l)
Removes a listener.
|
call, getDelimiters, getDependencies, returnDelimitersAsToken
getImportance
protected Object _initialValue
public void addActionListener(ActionListener l)
l
- the new listenerpublic void removeActionListener(ActionListener l)
l
- the listener to removepublic String getName()
getName
in class IlvSDMCSSFunction
public String getShortDescription()
IlvLocaleUtil.getCurrentLocale()
.getShortDescription
in class IlvCSSFunction
public Object call(Object[] args, Class<?> type, IlvSDMEngine engine, Object node, Object target)
call
in class IlvSDMCSSFunction
args
- The parameters of the function.type
- The expected return type, which may be null
. It
is wise to return an object compatible with the expected type, or a
String.engine
- The current engine. It may be null
if the
IlvStyleSheetRenderer
is disconnected from an engine.node
- The current node. This is the current model object
being called on. Inside a @# construct, node represents the
parent of the fake node indeed used to process the @#
construct, i.e. the real node of interest.target
- The current rendered object being called on. Note that the
model object can easily be found if args
contains the
parameter id.public IlvSDMCSSFunction.Feedback[] invert(Object[] args, Object value, IlvSDMEngine engine, Object node)
NOTE: inverting a function is not always possible. This method can return null to indicate the inversion fails.
invert
in class IlvSDMCSSFunction
args
- The parameters of the functions, as they come from
the style sheet.value
- The value coming from the graphic objects.engine
- The current engine.node
- The model object.IllegalArgumentException
if the
function is not able to compute back the result, or null
if
"don't care." The default implementation returns null
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.