public class AnnotatedAction extends Action
ActionProxy. These actions are created via
ActionMap.register(java.lang.Object), which delegates the actual instantiation to an AnnotatedActionFactory.
Note that this class maintains a WeakReference to the supplied target object, so the existence of an
AnnotatedAction instance will not prevent the target from being garbage-collected.| Constructor and Description |
|---|
AnnotatedAction(java.lang.String text,
java.lang.reflect.Method method,
java.lang.Object target)
Instantiates an action that will call the specified method on the specified target.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getTarget()
Returns the target object (the object on which the annotated method will be called).
|
protected void |
handleAction(javafx.event.ActionEvent ae)
Handle the action-event by invoking the annotated method on the target object.
|
protected void |
handleActionException(javafx.event.ActionEvent ae,
java.lang.Throwable ex)
Called if the annotated method throws an exception when invoked.
|
java.lang.String |
toString()
Overridden to return the text of this action.
|
acceleratorProperty, disabledProperty, getAccelerator, getEventHandler, getGraphic, getLongText, getProperties, getStyle, getStyleClass, getText, graphicProperty, handle, isDisabled, isSelected, lock, longTextProperty, selectedProperty, setAccelerator, setDisabled, setEventHandler, setGraphic, setLongText, setSelected, setStyle, setText, styleProperty, textPropertypublic AnnotatedAction(java.lang.String text,
java.lang.reflect.Method method,
java.lang.Object target)
public java.lang.Object getTarget()
protected void handleAction(javafx.event.ActionEvent ae)
protected void handleActionException(javafx.event.ActionEvent ae,
java.lang.Throwable ex)
public java.lang.String toString()
toString in class java.lang.Object