KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > accessibility > AccessibleHypertext


1 /*
2  * @(#)AccessibleHypertext.java 1.12 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.accessibility;
9
10
11 import java.util.*;
12 import java.awt.*;
13 import javax.swing.text.*;
14
15
16 /**
17  * <P>The AccessibleHypertext class is the base class for all
18  * classes that present hypertext information on the display. This class
19  * provides the standard mechanism for an assistive technology to access
20  * that text via its content, attributes, and spatial location.
21  * It also provides standard mechanisms for manipulating hyperlinks.
22  * Applications can determine if an object supports the AccessibleHypertext
23  * interface by first obtaining its AccessibleContext (see {@link Accessible})
24  * and then calling the {@link AccessibleContext#getAccessibleText}
25  * method of AccessibleContext. If the return value is a class which extends
26  * AccessibleHypertext, then that object supports AccessibleHypertext.
27  *
28  * @see Accessible
29  * @see Accessible#getAccessibleContext
30  * @see AccessibleContext
31  * @see AccessibleText
32  * @see AccessibleContext#getAccessibleText
33  *
34  * @version
35  * @author Peter Korn
36  */

37 public interface AccessibleHypertext extends AccessibleText JavaDoc {
38
39     /**
40      * Returns the number of links within this hypertext document.
41      *
42      * @return number of links in this hypertext doc.
43      */

44     public abstract int getLinkCount();
45
46     /**
47      * Returns the nth Link of this Hypertext document.
48      *
49      * @param linkIndex within the links of this Hypertext
50      * @return Link object encapsulating the nth link(s)
51      */

52     public abstract AccessibleHyperlink JavaDoc getLink(int linkIndex);
53
54     /**
55      * Returns the index into an array of hyperlinks that
56      * is associated with this character index, or -1 if there
57      * is no hyperlink associated with this index.
58      *
59      * @param charIndex index within the text
60      * @return index into the set of hyperlinks for this hypertext doc.
61      */

62     public abstract int getLinkIndex(int charIndex);
63 }
64
Popular Tags