javax.swing
Class JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink

java.lang.Object
  extended by javax.accessibility.AccessibleHyperlink
      extended by javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink
All Implemented Interfaces:
AccessibleAction
Enclosing class:
JEditorPane.JEditorPaneAccessibleHypertextSupport

public class JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink
extends AccessibleHyperlink

The accessible representation of a HTML link.


Field Summary
 
Fields inherited from interface javax.accessibility.AccessibleAction
CLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUP
 
Constructor Summary
JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink(Element el)
          Creates a new HTMLLink.
 
Method Summary
 boolean doAccessibleAction(int i)
          Performs the specified action on the link object.
 Object getAccessibleActionAnchor(int i)
          Returns an object that represents the link anchor.
 int getAccessibleActionCount()
          Returns the number of AccessibleActions in this link object.
 String getAccessibleActionDescription(int i)
          Returns the description of the action at action index i.
 Object getAccessibleActionObject(int i)
          Returns an URL object, that represents the action at action index i.
 int getEndIndex()
          Returns the end index of the hyperlink element.
 int getStartIndex()
          Returns the start index of the hyperlink element.
 boolean isValid()
          Returns true if this HTMLLink is still valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink

public JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink(Element el)
Creates a new HTMLLink.

Parameters:
el - the link element
Method Detail

isValid

public boolean isValid()
Returns true if this HTMLLink is still valid. A HTMLLink can become invalid when the document changes.

Specified by:
isValid in class AccessibleHyperlink
Returns:
true if this HTMLLink is still valid

getAccessibleActionCount

public int getAccessibleActionCount()
Returns the number of AccessibleActions in this link object. In general, link have 1 AccessibleAction associated with them. There are special cases where links can have multiple actions associated, like in image maps.

Specified by:
getAccessibleActionCount in interface AccessibleAction
Specified by:
getAccessibleActionCount in class AccessibleHyperlink
Returns:
the number of AccessibleActions in this link object

doAccessibleAction

public boolean doAccessibleAction(int i)
Performs the specified action on the link object. This ususally means activating the link.

Specified by:
doAccessibleAction in interface AccessibleAction
Specified by:
doAccessibleAction in class AccessibleHyperlink
Parameters:
i - the action to perform, 0-based
Returns:
true if the action has been performed successfully, false otherwise
See Also:
AccessibleHyperlink.getAccessibleActionCount()

getAccessibleActionDescription

public String getAccessibleActionDescription(int i)
Returns the description of the action at action index i. This method returns the text within the element associated with this link.

Specified by:
getAccessibleActionDescription in interface AccessibleAction
Specified by:
getAccessibleActionDescription in class AccessibleHyperlink
Parameters:
i - the action index
Returns:
the description of the action at action index i
See Also:
AccessibleHyperlink.getAccessibleActionCount()

getAccessibleActionObject

public Object getAccessibleActionObject(int i)
Returns an URL object, that represents the action at action index i.

Specified by:
getAccessibleActionObject in class AccessibleHyperlink
Parameters:
i - the action index
Returns:
an URL object, that represents the action at action index i
See Also:
AccessibleHyperlink.getAccessibleActionCount()

getAccessibleActionAnchor

public Object getAccessibleActionAnchor(int i)
Returns an object that represents the link anchor. For examples, if the link encloses a string, then a String object is returned, if the link encloses an <img> tag, then an ImageIcon object is returned.

Specified by:
getAccessibleActionAnchor in class AccessibleHyperlink
Parameters:
i - the link to retrieve, 0-based
Returns:
an object that represents the link anchor
See Also:
AccessibleHyperlink.getAccessibleActionCount()

getStartIndex

public int getStartIndex()
Returns the start index of the hyperlink element.

Specified by:
getStartIndex in class AccessibleHyperlink
Returns:
the start index of the hyperlink element

getEndIndex

public int getEndIndex()
Returns the end index of the hyperlink element.

Specified by:
getEndIndex in class AccessibleHyperlink
Returns:
the end index of the hyperlink element