Class AnnotatedAction

    • Constructor Detail

      • AnnotatedAction

        public AnnotatedAction​(String text,
                               Method method,
                               Object target)
        Instantiates an action that will call the specified method on the specified target.
    • Method Detail

      • getTarget

        public Object getTarget()
        Returns the target object (the object on which the annotated method will be called).
        Returns:
        The target object, or null if the target object has been garbage-collected.
      • handleAction

        protected void handleAction​(ActionEvent ae)
        Handle the action-event by invoking the annotated method on the target object. If an exception is thrown, then the default implementation of this method will call handleActionException().
      • handleActionException

        protected void handleActionException​(ActionEvent ae,
                                             Throwable ex)
        Called if the annotated method throws an exception when invoked. The default implementation of this method simply prints the stack trace of the specified exception.
      • toString

        public String toString()
        Overridden to return the text of this action.
        Overrides:
        toString in class Object