Documentation of 'org.jdesktop.swingx.hyperlink.HyperlinkAction' Java class
HyperlinkAction
org.jdesktop.swingx.hyperlink

Class HyperlinkAction

  • 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 HyperlinkAction
    extends AbstractHyperlinkAction<java.net.URI>
    A implementation wrapping Desktop actions BROWSE and MAIL, that is URI-related.
    See Also:
    Serialized Form
    • Constructor Detail

      • HyperlinkAction

        public HyperlinkAction()
        Instantiates a HyperlinkAction with action type BROWSE.
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        java.lang.UnsupportedOperationException - if the current platform doesn't support Desktop
        java.lang.IllegalArgumentException - if unsupported action type
      • HyperlinkAction

        public HyperlinkAction(java.awt.Desktop.Action desktopAction)
        Instantiates a HyperlinkAction with the given action type.
        Parameters:
        desktopAction - the type of desktop action this class should perform, must be BROWSE or MAIL
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        java.lang.UnsupportedOperationException - if the current platform doesn't support Desktop
        java.lang.IllegalArgumentException - if unsupported action type
      • HyperlinkAction

        public HyperlinkAction(java.net.URI uri,
                               java.awt.Desktop.Action desktopAction)
        Parameters:
        uri - the target uri, maybe null.
        desktopAction - the type of desktop action this class should perform, must be BROWSE or MAIL
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        java.lang.UnsupportedOperationException - if the current platform doesn't support Desktop
        java.lang.IllegalArgumentException - if unsupported action type
    • Method Detail

      • createHyperlinkAction

        public static HyperlinkAction createHyperlinkAction(java.net.URI uri)
        Factory method to create and return a HyperlinkAction for the given uri. Tries to guess the appropriate type from the uri. If uri is not null and has a scheme of mailto, create one of type Mail. In all other cases, creates one for BROWSE.
        Parameters:
        uri - to uri to create a HyperlinkAction for, maybe null.
        Returns:
        a HyperlinkAction for the given URI.
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        java.lang.UnsupportedOperationException - if the current platform doesn't support Desktop
      • createHyperlinkAction

        public static HyperlinkAction createHyperlinkAction(java.net.URI uri,
                                                            java.awt.Desktop.Action type)
        Creates and returns a HyperlinkAction with the given target and action type.
        Parameters:
        uri - the target uri, maybe null.
        desktopAction - the type of desktop action this class should perform, must be BROWSE or MAIL
        Returns:
        a HyperlinkAction
        Throws:
        java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true
        java.lang.UnsupportedOperationException - if the current platform doesn't support Desktop
        java.lang.IllegalArgumentException - if unsupported action type
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent e)

        Implemented to perform the appropriate Desktop action if supported on the current target. Sets the visited property to true if the desktop action doesn't throw an exception or to false if it did. Does nothing if the action isn't supported.

      • getDesktopAction

        public java.awt.Desktop.Action getDesktopAction()
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.