javax.swing

Class JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink

Enclosing Class:
JEditorPane.JEditorPaneAccessibleHypertextSupport
Implemented Interfaces:
AccessibleAction

public class JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink
extends AccessibleHyperlink

The accessible representation of a HTML link.

Fields inherited from interface javax.accessibility.AccessibleAction

DECREMENT, INCREMENT, TOGGLE_EXPAND

Constructor Summary

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 javax.accessibility.AccessibleHyperlink

doAccessibleAction, getAccessibleActionAnchor, getAccessibleActionCount, getAccessibleActionDescription, getAccessibleActionObject, getEndIndex, getStartIndex, isValid

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

HTMLLink

public HTMLLink(Element el)
Creates a new HTMLLink.
Parameters:
el - the link element

Method Details

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
Overrides:
doAccessibleAction in interface AccessibleHyperlink
Returns:
true if the action has been performed successfully, false otherwise

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.
Overrides:
getAccessibleActionAnchor in interface AccessibleHyperlink
Returns:
an object that represents the link anchor

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
Overrides:
getAccessibleActionCount in interface AccessibleHyperlink
Returns:
the number of AccessibleActions in this link object

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
Overrides:
getAccessibleActionDescription in interface AccessibleHyperlink
Parameters:
i - the action index
Returns:
the description of the action at action index i

getAccessibleActionObject

public Object getAccessibleActionObject(int i)
Returns an URL object, that represents the action at action index i.
Overrides:
getAccessibleActionObject in interface AccessibleHyperlink
Parameters:
i - the action index
Returns:
an URL object, that represents the action at action index i

getEndIndex

public int getEndIndex()
Returns the end index of the hyperlink element.
Overrides:
getEndIndex in interface AccessibleHyperlink
Returns:
the end index of the hyperlink element

getStartIndex

public int getStartIndex()
Returns the start index of the hyperlink element.
Overrides:
getStartIndex in interface AccessibleHyperlink
Returns:
the start index of the hyperlink element

isValid

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

JEditorPane.java -- Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.