001 /* AccessibleRole.java -- the primary role of an accessible object
002 Copyright (C) 2002, 2005 Free Software Foundation
003
004 This file is part of GNU Classpath.
005
006 GNU Classpath is free software; you can redistribute it and/or modify
007 it under the terms of the GNU General Public License as published by
008 the Free Software Foundation; either version 2, or (at your option)
009 any later version.
010
011 GNU Classpath is distributed in the hope that it will be useful, but
012 WITHOUT ANY WARRANTY; without even the implied warranty of
013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 General Public License for more details.
015
016 You should have received a copy of the GNU General Public License
017 along with GNU Classpath; see the file COPYING. If not, write to the
018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
019 02110-1301 USA.
020
021 Linking this library statically or dynamically with other modules is
022 making a combined work based on this library. Thus, the terms and
023 conditions of the GNU General Public License cover the whole
024 combination.
025
026 As a special exception, the copyright holders of this library give you
027 permission to link this library with independent modules to produce an
028 executable, regardless of the license terms of these independent
029 modules, and to copy and distribute the resulting executable under
030 terms of your choice, provided that you also meet, for each linked
031 independent module, the terms and conditions of the license of that
032 module. An independent module is a module which is not derived from
033 or based on this library. If you modify this library, you may extend
034 this exception to your version of the library, but you are not
035 obligated to do so. If you do not wish to do so, delete this
036 exception statement from your version. */
037
038 package javax.accessibility;
039
040 import java.util.Locale;
041
042 /**
043 * The role of an accessible object. For example, this could be "button" or
044 * "table". This strongly typed "enumeration" supports localized strings. If
045 * the constants of this class are not adequate, new ones may be added in a
046 * similar matter, while avoiding a public constructor.
047 *
048 * @author Eric Blake (ebb9@email.byu.edu)
049 * @since 1.2
050 * @status updated to 1.4
051 */
052 public class AccessibleRole extends AccessibleBundle
053 {
054 /** The object alerts the user about something. */
055 public static final AccessibleRole ALERT
056 = new AccessibleRole("alert");
057
058 /** The header for a column of data. */
059 public static final AccessibleRole COLUMN_HEADER
060 = new AccessibleRole("column header");
061
062 /**
063 * The object can be drawn into, and traps events.
064 *
065 * @see #FRAME
066 * @see #GLASS_PANE
067 * @see #LAYERED_PANE
068 */
069 public static final AccessibleRole CANVAS
070 = new AccessibleRole("canvas");
071
072 /**
073 * A list of choices, which may optionally allow the user to create a new
074 * choice.
075 */
076 public static final AccessibleRole COMBO_BOX
077 = new AccessibleRole("combo box");
078
079 /**
080 * An iconified frame in a desktop.
081 *
082 * @see #DESKTOP_PANE
083 * @see #INTERNAL_FRAME
084 */
085 public static final AccessibleRole DESKTOP_ICON
086 = new AccessibleRole("desktop icon");
087
088 /**
089 * A frame-like object clipped by a desktop pane.
090 *
091 * @see #DESKTOP_ICON
092 * @see #DESKTOP_PANE
093 * @see #FRAME
094 */
095 public static final AccessibleRole INTERNAL_FRAME
096 = new AccessibleRole("internal frame");
097
098 /**
099 * A pane which supports internal frames and their icons.
100 *
101 * @see #DESKTOP_ICON
102 * @see #INTERNAL_FRAME
103 */
104 public static final AccessibleRole DESKTOP_PANE
105 = new AccessibleRole("desktop pane");
106
107 /**
108 * A specialized pane for use in a dialog.
109 *
110 * @see #DIALOG
111 */
112 public static final AccessibleRole OPTION_PANE
113 = new AccessibleRole("option pane");
114
115 /**
116 * A top level window with no title or border.
117 *
118 * @see #FRAME
119 * @see #DIALOG
120 */
121 public static final AccessibleRole WINDOW
122 = new AccessibleRole("window");
123
124 /**
125 * A top level window with title, menu bar, border, and so forth. It is
126 * often the primary window of an application.
127 *
128 * @see #DIALOG
129 * @see #CANVAS
130 * @see #WINDOW
131 */
132 public static final AccessibleRole FRAME
133 = new AccessibleRole("frame");
134
135 /**
136 * A top level window title bar and border. It is limited compared to a
137 * frame, and is often a secondary window.
138 *
139 * @see #FRAME
140 * @see #WINDOW
141 */
142 public static final AccessibleRole DIALOG
143 = new AccessibleRole("dialog");
144
145 /** A specialized dialog for choosing a color. */
146 public static final AccessibleRole COLOR_CHOOSER
147 = new AccessibleRole("color chooser");
148
149 /**
150 * A pane for navigating through directories.
151 *
152 * @see #FILE_CHOOSER
153 */
154 public static final AccessibleRole DIRECTORY_PANE
155 = new AccessibleRole("directory pane");
156
157 /**
158 * A specialized dialog that allows a user to select a file.
159 *
160 * @see #DIRECTORY_PANE
161 */
162 public static final AccessibleRole FILE_CHOOSER
163 = new AccessibleRole("file chooser");
164
165 /** An object to fill space between other components. */
166 public static final AccessibleRole FILLER
167 = new AccessibleRole("filler");
168
169 /** A hypertext anchor. */
170 public static final AccessibleRole HYPERLINK
171 = new AccessibleRole("hyperlink");
172
173 /** A small picture to decorate components. */
174 public static final AccessibleRole ICON
175 = new AccessibleRole("icon");
176
177 /** An object to label something in a graphic interface. */
178 public static final AccessibleRole LABEL
179 = new AccessibleRole("label");
180
181 /**
182 * A specialized pane with a glass pane and layered pane as children.
183 *
184 * @see #GLASS_PANE
185 * @see #LAYERED_PANE
186 */
187 public static final AccessibleRole ROOT_PANE
188 = new AccessibleRole("root pane");
189
190 /**
191 * A pane guaranteed to be painted on top of panes beneath it.
192 *
193 * @see #ROOT_PANE
194 * @see #LAYERED_PANE
195 */
196 public static final AccessibleRole GLASS_PANE
197 = new AccessibleRole("glass pane");
198
199 /**
200 * A specialized pane that allows drawing children in layers. This is often
201 * used in menus and other visual components.
202 *
203 * @see #ROOT_PANE
204 * @see #GLASS_PANE
205 */
206 public static final AccessibleRole LAYERED_PANE
207 = new AccessibleRole("layered pane");
208
209 /**
210 * An object which presents a list of items for selection. Often contained
211 * in a scroll pane.
212 *
213 * @see #SCROLL_PANE
214 * @see #LIST_ITEM
215 */
216 public static final AccessibleRole LIST
217 = new AccessibleRole("list");
218
219 /**
220 * An object which represents an item in a list. Often contained in a scroll
221 * pane.
222 *
223 * @see #SCROLL_PANE
224 * @see #LIST
225 */
226 public static final AccessibleRole LIST_ITEM
227 = new AccessibleRole("list item");
228
229 /**
230 * An object usually at the top of a frame to list available menus.
231 *
232 * @see #MENU
233 * @see #POPUP_MENU
234 * @see #LAYERED_PANE
235 */
236 public static final AccessibleRole MENU_BAR
237 = new AccessibleRole("menu bar");
238
239 /**
240 * A temporary window with a menu of options, which hides on selection.
241 *
242 * @see #MENU
243 * @see #MENU_ITEM
244 */
245 public static final AccessibleRole POPUP_MENU
246 = new AccessibleRole("popup menu");
247
248 /**
249 * An object usually in a menu bar which contains a list of actions to
250 * perform. Such actions are usually associated with menu items or submenus.
251 *
252 * @see #MENU_BAR
253 * @see #MENU_ITEM
254 * @see #SEPARATOR
255 * @see #RADIO_BUTTON
256 * @see #CHECK_BOX
257 * @see #POPUP_MENU
258 */
259 public static final AccessibleRole MENU
260 = new AccessibleRole("menu");
261
262 /**
263 * An object usually in a menu with an action available for the user.
264 *
265 * @see #MENU_BAR
266 * @see #SEPARATOR
267 * @see #POPUP_MENU
268 */
269 public static final AccessibleRole MENU_ITEM
270 = new AccessibleRole("menu item");
271
272 /**
273 * An object usually in a menu which separates logical sections of items.
274 *
275 * @see #MENU
276 * @see #MENU_ITEM
277 */
278 public static final AccessibleRole SEPARATOR
279 = new AccessibleRole("separator");
280
281 /**
282 * An object which presents a series of panels, usually via tabs along the
283 * top. Children are all page tabs.
284 *
285 * @see #PAGE_TAB
286 */
287 public static final AccessibleRole PAGE_TAB_LIST
288 = new AccessibleRole("page tab list");
289
290 /**
291 * An object in a page tab list, which contains the panel to display when
292 * selected from the list.
293 *
294 * @see #PAGE_TAB_LIST
295 */
296 public static final AccessibleRole PAGE_TAB
297 = new AccessibleRole("page tab");
298
299 /** A generic container to group objects. */
300 public static final AccessibleRole PANEL
301 = new AccessibleRole("panel");
302
303 /** An object used to track amount of a task that has completed. */
304 public static final AccessibleRole PROGRESS_BAR
305 = new AccessibleRole("progress bar");
306
307 /** An object for passwords which should not be shown to the user. */
308 public static final AccessibleRole PASSWORD_TEXT
309 = new AccessibleRole("password text");
310
311 /**
312 * An object that can be manipulated to do something.
313 *
314 * @see #CHECK_BOX
315 * @see #TOGGLE_BUTTON
316 * @see #RADIO_BUTTON
317 */
318 public static final AccessibleRole PUSH_BUTTON
319 = new AccessibleRole("push button");
320
321 /**
322 * A specialized button which can be on or off, with no separate indicator.
323 *
324 * @see #PUSH_BUTTON
325 * @see #CHECK_BOX
326 * @see #RADIO_BUTTON
327 */
328 public static final AccessibleRole TOGGLE_BUTTON
329 = new AccessibleRole("toggle button");
330
331 /**
332 * A choice which can be on or off, and has a separate indicator.
333 *
334 * @see #PUSH_BUTTON
335 * @see #TOGGLE_BUTTON
336 * @see #RADIO_BUTTON
337 */
338 public static final AccessibleRole CHECK_BOX
339 = new AccessibleRole("check box");
340
341 /**
342 * A specialized choice which toggles radio buttons in the group when it
343 * is selected.
344 *
345 * @see #PUSH_BUTTON
346 * @see #TOGGLE_BUTTON
347 * @see #CHECK_BOX
348 */
349 public static final AccessibleRole RADIO_BUTTON
350 = new AccessibleRole("radio button");
351
352 /** The header for a row of data. */
353 public static final AccessibleRole ROW_HEADER
354 = new AccessibleRole("row header");
355
356 /**
357 * An object which allows an incremental view of a larger pane.
358 *
359 * @see #SCROLL_BAR
360 * @see #VIEWPORT
361 */
362 public static final AccessibleRole SCROLL_PANE
363 = new AccessibleRole("scroll pane");
364
365 /**
366 * An object which allows selection of the view in a scroll pane.
367 *
368 * @see #SCROLL_PANE
369 */
370 public static final AccessibleRole SCROLL_BAR
371 = new AccessibleRole("scroll bar");
372
373 /**
374 * An object which represents the visual section in a scroll pane.
375 *
376 * @see #SCROLL_PANE
377 */
378 public static final AccessibleRole VIEWPORT
379 = new AccessibleRole("viewport");
380
381 /** An object which allows selection in a bounded range. */
382 public static final AccessibleRole SLIDER
383 = new AccessibleRole("slider");
384
385 /**
386 * A specialized pane which presents two other panels, and can often adjust
387 * the divider between them.
388 */
389 public static final AccessibleRole SPLIT_PANE
390 = new AccessibleRole("split pane");
391
392 /** An object for presenting data in rows and columns. */
393 public static final AccessibleRole TABLE
394 = new AccessibleRole("table");
395
396 /**
397 * An object which represents text, usually editable by the user.
398 *
399 * @see #LABEL
400 */
401 public static final AccessibleRole TEXT
402 = new AccessibleRole("text");
403
404 /**
405 * An object which represents a hierachical view of data. Subnodes can
406 * often be expanded or collapsed.
407 */
408 public static final AccessibleRole TREE
409 = new AccessibleRole("tree");
410
411 /** A bar or pallete with buttons for common actions in an application. */
412 public static final AccessibleRole TOOL_BAR
413 = new AccessibleRole("tool bar");
414
415 /**
416 * An object which provides information about another object. This is often
417 * displayed as a "help bubble" when a mouse hovers over the other object.
418 */
419 public static final AccessibleRole TOOL_TIP
420 = new AccessibleRole("tool tip");
421
422 /**
423 * An AWT component with nothing else known about it.
424 *
425 * @see #SWING_COMPONENT
426 * @see #UNKNOWN
427 */
428 public static final AccessibleRole AWT_COMPONENT
429 = new AccessibleRole("AWT component");
430
431 /**
432 * A swing component with nothing else known about it.
433 *
434 * @see #AWT_COMPONENT
435 * @see #UNKNOWN
436 */
437 public static final AccessibleRole SWING_COMPONENT
438 = new AccessibleRole("SWING component");
439
440 /**
441 * An accessible object whose role is unknown.
442 *
443 * @see #AWT_COMPONENT
444 * @see #SWING_COMPONENT
445 */
446 public static final AccessibleRole UNKNOWN
447 = new AccessibleRole("unknown");
448
449 /** A component with multiple labels of status information. */
450 public static final AccessibleRole STATUS_BAR
451 = new AccessibleRole("statusbar");
452
453 /** A component which allows editing of Date and Time objects. */
454 public static final AccessibleRole DATE_EDITOR
455 = new AccessibleRole("dateeditor");
456
457 /** A component with spinner arrows for simple numbers. */
458 public static final AccessibleRole SPIN_BOX
459 = new AccessibleRole("spinbox");
460
461 /** A component for choosing fonts and their attributes. */
462 public static final AccessibleRole FONT_CHOOSER
463 = new AccessibleRole("fontchooser");
464
465 /** A component with a border to group other components. */
466 public static final AccessibleRole GROUP_BOX
467 = new AccessibleRole("groupbox");
468
469 /**
470 * A formula for creating a value.
471 *
472 * @since 1.5
473 */
474 public static final AccessibleRole EDITBAR
475 = new AccessibleRole("editbar");
476
477 /**
478 * A text-based footer.
479 *
480 * @since 1.5
481 */
482 public static final AccessibleRole FOOTER
483 = new AccessibleRole("footer");
484
485 /**
486 * A text-based header.
487 *
488 * @since 1.5
489 */
490 public static final AccessibleRole HEADER
491 = new AccessibleRole("header");
492
493
494 /**
495 * A text-based paragraph.
496 *
497 * @since 1.5
498 */
499 public static final AccessibleRole PARAGRAPH
500 = new AccessibleRole("paragraph");
501
502 /**
503 * Represents the current level of progress on a particular task.
504 *
505 * @since 1.5
506 */
507 public static final AccessibleRole PROGRESS_MONITOR
508 = new AccessibleRole("progress monitor");
509
510 /**
511 * A ruler is a method of measuring the distance between two
512 * points.
513 *
514 * @since 1.5
515 */
516 public static final AccessibleRole RULER
517 = new AccessibleRole("ruler");
518
519 /**
520 * A HTML container is an accessible object which contains other
521 * accessible objects that together form some HTML content. For example,
522 * the content may be a sequence of text containing a link, which
523 * would be represent as two children, one an {@link AccessibleText}
524 * object holding the normal text and the other an
525 * {@link AccessibleHypertext} object representing the link.
526 *
527 * @since 1.6
528 */
529 public static final AccessibleRole HTML_CONTAINER
530 = new AccessibleRole("HTML container");
531
532 /**
533 * Create a new constant with a locale independent key. Follow the example,
534 * keep the constructor private and make public constants instead.
535 *
536 * @param key the name of the role
537 * @see #toDisplayString(String, Locale)
538 */
539 protected AccessibleRole(String key)
540 {
541 this.key = key;
542 }
543 } // class AccessibleRole