Class OpenBrowserAction

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

    public class OpenBrowserAction
    extends javax.swing.AbstractAction
    An action for opening a URI in a browser. The URI may be null and if so this action does nothing.
    Author:
    Karl Schaefer, joshy (original version)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenBrowserAction()
      Creates a new instance of OpenBrowserAction
      OpenBrowserAction​(java.lang.String uri)
      Creates a new action for the specified URI.
      OpenBrowserAction​(java.net.URI uri)
      Creates a new action for the specified URI.
      OpenBrowserAction​(java.net.URL url)
      Creates a new action for the specified URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      java.net.URI getURI()
      Gets the current URI.
      void setURI​(java.net.URI uri)
      Sets the current URI.
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Constructor Detail

      • OpenBrowserAction

        public OpenBrowserAction()
        Creates a new instance of OpenBrowserAction
      • OpenBrowserAction

        public OpenBrowserAction​(java.lang.String uri)
        Creates a new action for the specified URI.
        Parameters:
        uri - the URI
        Throws:
        java.lang.NullPointerException - if uri is null
        java.lang.IllegalArgumentException - if the given string violates RFC 2396
      • OpenBrowserAction

        public OpenBrowserAction​(java.net.URL url)
                          throws java.net.URISyntaxException
        Creates a new action for the specified URL.
        Parameters:
        url - the URL
        Throws:
        java.net.URISyntaxException - if the URL cannot be converted to a valid URI
      • OpenBrowserAction

        public OpenBrowserAction​(java.net.URI uri)
        Creates a new action for the specified URI.
        Parameters:
        uri - the URI
    • Method Detail

      • getURI

        public java.net.URI getURI()
        Gets the current URI.
        Returns:
        the URI
      • setURI

        public void setURI​(java.net.URI uri)
        Sets the current URI.
        Parameters:
        uri - the new URI
      • actionPerformed

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