source: trunk/gcc/libjava/javax/accessibility/AccessibleTable.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: 6.8 KB
Line 
1/* AccessibleTable.java -- aids in accessibly manipulating tables
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 * Objects which present information in a 2-dimensional table should implement
43 * this interface. Accessibility software can use the implementations of
44 * this interface to navigate and change the attributes of the table.
45 *
46 * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
47 * should return <code>null</code> if an object does not implement this
48 * interface.
49 *
50 * @author Eric Blake <ebb9@email.byu.edu>
51 * @see Accessible
52 * @see AccessibleContext
53 * @see AccessibleContext#getAccessibleTable()
54 * @since 1.2
55 * @status updated to 1.4
56 */
57public interface AccessibleTable
58{
59 /**
60 * Return the caption for the table, or null if unknown.
61 *
62 * @return the table caption
63 */
64 Accessible getAccessibleCaption();
65
66 /**
67 * Set the table caption.
68 *
69 * @param caption the new caption
70 */
71 void setAccessibleCaption(Accessible caption);
72
73 /**
74 * Return the summary description of the table, or null if unknown.
75 *
76 * @return the summary description
77 */
78 Accessible getAccessibleSummary();
79
80 /**
81 * Set the table summary description.
82 *
83 * @param summary the new summary
84 */
85 void setAccessibleSummary(Accessible summary);
86
87 /**
88 * Return the number of rows in the table.
89 *
90 * @return the row count
91 */
92 int getAccessibleRowCount();
93
94 /**
95 * Return the number of columns in the table.
96 *
97 * @return the column count
98 */
99 int getAccessibleColumnCount();
100
101 /**
102 * Return the cell at the specified row and column, or null if out of bounds.
103 *
104 * @param r the 0-based row index
105 * @param c the 0-based column index
106 * @return the cell at (r,c)
107 */
108 Accessible getAccessibleAt(int r, int c);
109
110 /**
111 * Returns the number of merged rows occupied at the specified row and
112 * column, or 0 if out of bounds.
113 *
114 * @param r the 0-based row index
115 * @param c the 0-based column index
116 * @return the row extent at (r,c)
117 */
118 int getAccessibleRowExtentAt(int r, int c);
119
120 /**
121 * Returns the number of merged columns occupied at the specified row and
122 * column, or 0 if out of bounds.
123 *
124 * @param r the 0-based row index
125 * @param c the 0-based column index
126 * @return the column extent at (r,c)
127 */
128 int getAccessibleColumnExtentAt(int r, int c);
129
130 /**
131 * Return the row headers as a table.
132 *
133 * @return the row headers, or null if there are none
134 */
135 AccessibleTable getAccessibleRowHeader();
136
137 /**
138 * Set the row headers.
139 *
140 * @param header the new row header
141 */
142 // XXX What happens if header is incompatible size?
143 void setAccessibleRowHeader(AccessibleTable header);
144
145 /**
146 * Return the column headers as a table.
147 *
148 * @return the column headers, or null if there are none
149 */
150 AccessibleTable getAccessibleColumnHeader();
151
152 /**
153 * Set the column headers.
154 *
155 * @param header the new column header
156 */
157 // XXX What happens if header is incompatible size?
158 void setAccessibleColumnHeader(AccessibleTable header);
159
160 /**
161 * Return the description of a row, or null if there is none or the index
162 * is out of bounds.
163 *
164 * @param r the 0-based row index
165 * @return the description
166 */
167 Accessible getAccessibleRowDescription(int r);
168
169 /**
170 * Set the description of a row. Does nothing if the index is invalid.
171 *
172 * @param r the 0-based row index
173 * @param description the new description
174 */
175 void setAccessibleRowDescription(int r, Accessible description);
176
177 /**
178 * Return the description of a column, or null if there is none or the index
179 * is out of bounds.
180 *
181 * @param c the 0-based column index
182 * @return the description
183 */
184 Accessible getAccessibleColumnDescription(int c);
185
186 /**
187 * Set the description of a column. Does nothing if the index is invalid.
188 *
189 * @param c the 0-based column index
190 * @param description the new description
191 */
192 void setAccessibleColumnDescription(int c, Accessible description);
193
194 /**
195 * Return whether the cell at the specified location is selected. Returns
196 * false if the index is out of bounds.
197 *
198 * @param r the 0-based row index
199 * @param c the 0-based column index
200 * @return true if that cell is selected
201 */
202 boolean isAccessibleSelected(int r, int c);
203
204 /**
205 * Return whether the specified row is selected. Returns false if the
206 * index is out of bounds.
207 *
208 * @param r the 0-based row index
209 * @return true if that row is selected
210 */
211 boolean isAccessibleRowSelected(int r);
212
213 /**
214 * Return whether the specified column is selected. Returns false if the
215 * index is out of bounds.
216 *
217 * @param c the 0-based column index
218 * @return true if that column is selected
219 */
220 boolean isAccessibleColumnSelected(int c);
221
222 /**
223 * Return the selected rows. May be null or empty if there is no selection.
224 *
225 * @return the indices of selected rows
226 */
227 int[] getSelectedAccessibleRows();
228
229 /**
230 * Return the selected columns. May be null or empty if there is no
231 * selection.
232 *
233 * @return the indices of selected columns
234 */
235 int[] getSelectedAccessibleColumns();
236} // interface AccessibleTable
Note: See TracBrowser for help on using the repository browser.