Class LinkModelAction<T extends LinkModel>

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.ItemListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class LinkModelAction<T extends LinkModel>
    extends AbstractHyperlinkAction<T>
    Specialized LinkAction for a target of type LinkModel.

    This action delegates actionPerformed to vistingDelegate. PENDING: move to swingx package?

    Author:
    Jeanette Winzenburg
    See Also:
    Serialized Form
    • Constructor Detail

      • LinkModelAction

        public LinkModelAction()
      • LinkModelAction

        public LinkModelAction​(java.awt.event.ActionListener visitingDelegate)
      • LinkModelAction

        public LinkModelAction​(T target)
      • LinkModelAction

        public LinkModelAction​(T target,
                               java.awt.event.ActionListener visitingDelegate)
    • Method Detail

      • setVisitingDelegate

        public void setVisitingDelegate​(java.awt.event.ActionListener delegate)
        The delegate to invoke on actionPerformed.

        The delegates actionPerformed is invoked with an ActionEvent having the target as source. Delegates are expected to cope gracefully with the T.

        PENDING: JW - How to formalize?

        Parameters:
        delegate - the action invoked on the target.
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        This action delegates to the visitingDelegate if both delegate and target are != null, does nothing otherwise. The actionEvent carries the target as source. PENDING: pass through a null target? - most probably!
      • uninstallTarget

        protected void uninstallTarget()
        removes the propertyChangeListener.

        Implementation NOTE: this does not clean-up internal state! There is no need to because updateFromTarget handles both null and not-null targets. Hmm...

        Overrides:
        uninstallTarget in class AbstractHyperlinkAction<T extends LinkModel>
      • updateFromTarget

        protected void updateFromTarget()