Class AccessibleHyperlink
- All Implemented Interfaces:
AccessibleAction
- Direct Known Subclasses:
JEditorPane.JEditorPaneAccessibleHypertextSupport.HTMLLink
public abstract class AccessibleHyperlink extends Object implements AccessibleAction
Field Summary
Fields declared in interface javax.accessibility.AccessibleAction
CLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUP
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected |
Constructor for subclasses to call. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
abstract boolean |
doAccessibleAction |
Performs the specified action on the object. |
abstract Object |
getAccessibleActionAnchor |
Returns an object that represents the link anchor, as appropriate for that link. |
abstract int |
getAccessibleActionCount() |
Returns the number of accessible actions available in this Link If there are more than one, the first one is NOT considered the "default" action of this LINK object (e.g. in an HTML imagemap). |
abstract String |
getAccessibleActionDescription |
Returns a string description of this particular link action. |
abstract Object |
getAccessibleActionObject |
Returns an object that represents the link action, as appropriate for that link. |
abstract int |
getEndIndex() |
Gets the index with the hypertext document at which this link ends. |
abstract int |
getStartIndex() |
Gets the index with the hypertext document at which this link begins. |
abstract boolean |
isValid() |
Since the document a link is associated with may have changed, this method returns whether or not this Link is still valid (with respect to the document it references). |
Constructor Details
AccessibleHyperlink
protected AccessibleHyperlink()
Method Details
isValid
public abstract boolean isValid()
- Returns:
- a flag indicating whether this link is still valid with respect to the
AccessibleHypertext
it belongs to
getAccessibleActionCount
public abstract int getAccessibleActionCount()
AccessibleAction
in them.- Specified by:
-
getAccessibleActionCount
in interfaceAccessibleAction
- Returns:
- the zero-based number of actions in this object
doAccessibleAction
public abstract boolean doAccessibleAction(int i)
- Specified by:
-
doAccessibleAction
in interfaceAccessibleAction
- Parameters:
-
i
- zero-based index of actions - Returns:
-
true
if the action was performed; otherwisefalse
- See Also:
getAccessibleActionDescription
public abstract String getAccessibleActionDescription(int i)
Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> this method would return "top hat"
- Specified by:
-
getAccessibleActionDescription
in interfaceAccessibleAction
- Parameters:
-
i
- zero-based index of the actions - Returns:
- a string description of the action
- See Also:
getAccessibleActionObject
public abstract Object getAccessibleActionObject(int i)
- Parameters:
-
i
- zero-based index of the actions - Returns:
- an object representing the hypertext link itself
- See Also:
getAccessibleActionAnchor
public abstract Object getAccessibleActionAnchor(int i)
String
containing the text: "Accessibility". Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> this might return the object ImageIcon("top-hat.gif", "top hat");
- Parameters:
-
i
- zero-based index of the actions - Returns:
- an object representing the hypertext anchor
- See Also:
getStartIndex
public abstract int getStartIndex()
- Returns:
- index of start of link
getEndIndex
public abstract int getEndIndex()
- Returns:
- index of end of link
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/accessibility/AccessibleHyperlink.html