source: trunk/gcc/libjava/javax/accessibility/AccessibleHyperlink.java

Last change on this file was 1389, checked in by bird, 21 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.8 KB
Line 
1/* AccessibleHyperlink.java -- aids in accessibly navigating hypertext
2 Copyright (C) 2002 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package javax.accessibility;
40
41/**
42 * This object encapsulates actions associated with navigating hypertext.
43 *
44 * @author Eric Blake <ebb9@email.byu.edu>
45 * @see Accessible
46 * @see AccessibleContext
47 * @see AccessibleText
48 * @see AccessibleContext#getAccessibleText()
49 * @since 1.2
50 * @status updated to 1.4
51 */
52public abstract class AccessibleHyperlink implements AccessibleAction
53{
54 /**
55 * The default constructor.
56 */
57 public AccessibleHyperlink()
58 {
59 }
60
61 /**
62 * Returns whether the document the link references is still valid, as the
63 * association may have changed with a text edit.
64 *
65 * @return true if the link is valid with respect to the AccessibleHypertext
66 */
67 public abstract boolean isValid();
68
69 /**
70 * Get the number possible actions for this object, starting from 0. In
71 * general, a hypertext link has only one action, except for an image map,
72 * so there isn't really a default action.
73 *
74 * @return the 0-based number of actions
75 */
76 public abstract int getAccessibleActionCount();
77
78 /**
79 * Perform the specified action. Does nothing if out of bounds.
80 *
81 * @param i the action to perform, 0-based
82 * @return true if the action was performed
83 * @see #getAccessibleActionCount()
84 */
85 public abstract boolean doAccessibleAction(int i);
86
87 /**
88 * Get the anchor text of the link, or null if the index is out of bounds.
89 * For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
90 * would return "GNU Home Page", while &lt;a HREF="#top"&gt;
91 * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
92 * "top hat".
93 *
94 * @param i the link to retrieve, 0-based
95 * @return the link anchor text
96 * @see #getAccessibleActionCount()
97 */
98 public abstract String getAccessibleActionDescription(int i);
99
100 /**
101 * Get the link location, or null if the index is out of bounds. For
102 * example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page&lt;/a&gt;
103 * would return a java.net.URL("http://www.gnu.org/").
104 *
105 * @param i the link to retrieve, 0-based
106 * @return the link location
107 * @see #getAccessibleActionCount()
108 */
109 public abstract String getAccessibleActionObject(int i);
110
111 /**
112 * Get the anchor appropriate for the link, or null if the index is out of
113 * bounds. For example, &lt;a href="http://www.gnu.org/"&gt;GNU Home Page
114 * &lt;/a&gt; would return "GNU Home Page", while &lt;a HREF="#top"&gt;
115 * &lt;img src="top-hat.png" alt="top hat"&gt;&lt;/a&gt; would return
116 * an ImageIcon("top-hat.png", "top hat").
117 *
118 * @param i the link to retrieve, 0-based
119 * @return the link anchor object
120 * @see #getAccessibleActionCount()
121 */
122 public abstract String getAccessibleActionAnchor(int i);
123
124 /**
125 * Gets the character index where this link starts in the parent hypertext
126 * document.
127 *
128 * @return the starting index
129 */
130 public abstract int getStartIndex();
131
132 /**
133 * Gets the character index where this link ends in the parent hypertext
134 * document.
135 *
136 * @return the ending index
137 */
138 public abstract int getEndIndex();
139} // class AccessibleAction
Note: See TracBrowser for help on using the repository browser.