Class HyperlinkAction.URIVisitor

java.lang.Object
org.jdesktop.swingx.hyperlink.HyperlinkAction.URIVisitor
Direct Known Subclasses:
HyperlinkAction.BrowseVisitor, HyperlinkAction.MailVisitor
Enclosing class:
HyperlinkAction

private abstract class HyperlinkAction.URIVisitor extends Object
Thin wrapper around Desktop functionality to allow uniform handling of different actions in HyperlinkAction.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract boolean
    Returns a boolean indicating if the action is supported by the current Desktop.
    boolean
    Returns a boolean indicating whether the action is supported on the given URI.
    abstract void
    visit(URI uri)
    Visits the given URI via Desktop functionality.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • desktopSupported

      protected boolean desktopSupported
  • Constructor Details

    • URIVisitor

      private URIVisitor()
  • Method Details

    • isEnabled

      public boolean isEnabled(URI uri)
      Returns a boolean indicating whether the action is supported on the given URI. This implementation returns true if both the Desktop is generally supported and isActionSupported(). PENDING JW: hmm ... which class exactly has to check for valid combination of Action and URI?
      Parameters:
      uri -
      Returns:
      See Also:
    • visit

      public abstract void visit(URI uri) throws IOException
      Visits the given URI via Desktop functionality. Must not be called if not enabled.
      Parameters:
      uri - the URI to visit
      Throws:
      IOException - if the Desktop method throws IOException.
    • isActionSupported

      protected abstract boolean isActionSupported()
      Returns a boolean indicating if the action is supported by the current Desktop.
      Returns:
      true if the Action is supported by the current desktop, false otherwise.