Class AbstractSendToAction

    • Constructor Detail

      • AbstractSendToAction

        public AbstractSendToAction()
    • Method Detail

      • setOwner

        public void setOwner​(SendToActionSupporter value)
        Sets the owner of this action.
        Parameters:
        value - the owner
      • getOwner

        public SendToActionSupporter getOwner()
        Returns the current owner of this action.
        Returns:
        the owner, null if none set
      • getAction

        public abstract String getAction()
        Returns the short description of the sendto action. Description gets used for menu items.
        Returns:
        the short description
      • getIconName

        public String getIconName()
        Returns the file name of the icon.
        Returns:
        the filename or null if no icon available
      • getIcon

        public ImageIcon getIcon()
        Returns the icon.
        Returns:
        the icon or empty icon if no icon name available
        See Also:
        getIconName()
      • accepts

        public abstract Class[] accepts()
        Returns the classes that the action accepts.
        Returns:
        the accepted classes
      • send

        public abstract String send​(Object o)
        Performs the actual sending/forwarding/processing of the data.
        Parameters:
        o - the object to send
        Returns:
        null if everything OK, otherwise error message
      • compareTo

        public int compareTo​(AbstractSendToAction o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Simply performs comparison on the action string.
        Specified by:
        compareTo in interface Comparable<AbstractSendToAction>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        See Also:
        getAction()
      • equals

        public boolean equals​(Object o)
        Returns whether the specified object is the same as this one.

        For AbstractSendToAction objects, it merely uses the action string for comparison.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare with
        Returns:
        true if both AbstractSendToAction instances and the same action string
        See Also:
        compareTo(AbstractSendToAction), getAction()
      • hashCode

        public int hashCode()
        Hashcode so can be used as hashtable key. Returns the hashcode of the getAction() string.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode