KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > accessibility > AccessibleRole


1 /*
2  * @(#)AccessibleRole.java 1.45 04/04/15
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 import java.util.Locale JavaDoc;
11 import java.util.MissingResourceException JavaDoc;
12 import java.util.ResourceBundle JavaDoc;
13
14 /**
15  * <P>Class AccessibleRole determines the role of a component. The role of a
16  * component describes its generic function. (E.G.,
17 * "push button," "table," or "list.")
18  * <p>The toDisplayString method allows you to obtain the localized string
19  * for a locale independent key from a predefined ResourceBundle for the
20  * keys defined in this class.
21  * <p>The constants in this class present a strongly typed enumeration
22  * of common object roles. A public constructor for this class has been
23  * purposely omitted and applications should use one of the constants
24  * from this class. If the constants in this class are not sufficient
25  * to describe the role of an object, a subclass should be generated
26  * from this class and it should provide constants in a similar manner.
27  *
28  * @version 1.45 04/15/04
29  * @author Willie Walker
30  * @author Peter Korn
31  * @author Lynn Monsanto
32  */

33 public class AccessibleRole extends AccessibleBundle JavaDoc {
34
35 // If you add or remove anything from here, make sure you
36
// update AccessibleResourceBundle.java.
37

38     /**
39      * Object is used to alert the user about something.
40      */

41     public static final AccessibleRole JavaDoc ALERT
42             = new AccessibleRole JavaDoc("alert");
43
44     /**
45      * The header for a column of data.
46      */

47     public static final AccessibleRole JavaDoc COLUMN_HEADER
48             = new AccessibleRole JavaDoc("columnheader");
49
50     /**
51      * Object that can be drawn into and is used to trap
52      * events.
53      * @see #FRAME
54      * @see #GLASS_PANE
55      * @see #LAYERED_PANE
56      */

57     public static final AccessibleRole JavaDoc CANVAS
58             = new AccessibleRole JavaDoc("canvas");
59
60     /**
61      * A list of choices the user can select from. Also optionally
62      * allows the user to enter a choice of their own.
63      */

64     public static final AccessibleRole JavaDoc COMBO_BOX
65             = new AccessibleRole JavaDoc("combobox");
66
67     /**
68      * An iconified internal frame in a DESKTOP_PANE.
69      * @see #DESKTOP_PANE
70      * @see #INTERNAL_FRAME
71      */

72     public static final AccessibleRole JavaDoc DESKTOP_ICON
73             = new AccessibleRole JavaDoc("desktopicon");
74
75     /**
76      * A frame-like object that is clipped by a desktop pane. The
77      * desktop pane, internal frame, and desktop icon objects are
78      * often used to create multiple document interfaces within an
79      * application.
80      * @see #DESKTOP_ICON
81      * @see #DESKTOP_PANE
82      * @see #FRAME
83      */

84     public static final AccessibleRole JavaDoc INTERNAL_FRAME
85             = new AccessibleRole JavaDoc("internalframe");
86
87     /**
88      * A pane that supports internal frames and
89      * iconified versions of those internal frames.
90      * @see #DESKTOP_ICON
91      * @see #INTERNAL_FRAME
92      */

93     public static final AccessibleRole JavaDoc DESKTOP_PANE
94             = new AccessibleRole JavaDoc("desktoppane");
95
96     /**
97      * A specialized pane whose primary use is inside a DIALOG
98      * @see #DIALOG
99      */

100     public static final AccessibleRole JavaDoc OPTION_PANE
101             = new AccessibleRole JavaDoc("optionpane");
102
103     /**
104      * A top level window with no title or border.
105      * @see #FRAME
106      * @see #DIALOG
107      */

108     public static final AccessibleRole JavaDoc WINDOW
109             = new AccessibleRole JavaDoc("window");
110
111     /**
112      * A top level window with a title bar, border, menu bar, etc. It is
113      * often used as the primary window for an application.
114      * @see #DIALOG
115      * @see #CANVAS
116      * @see #WINDOW
117      */

118     public static final AccessibleRole JavaDoc FRAME
119             = new AccessibleRole JavaDoc("frame");
120
121     /**
122      * A top level window with title bar and a border. A dialog is similar
123      * to a frame, but it has fewer properties and is often used as a
124      * secondary window for an application.
125      * @see #FRAME
126      * @see #WINDOW
127      */

128     public static final AccessibleRole JavaDoc DIALOG
129             = new AccessibleRole JavaDoc("dialog");
130
131     /**
132      * A specialized dialog that lets the user choose a color.
133      */

134     public static final AccessibleRole JavaDoc COLOR_CHOOSER
135             = new AccessibleRole JavaDoc("colorchooser");
136
137
138     /**
139      * A pane that allows the user to navigate through
140      * and select the contents of a directory. May be used
141      * by a file chooser.
142      * @see #FILE_CHOOSER
143      */

144     public static final AccessibleRole JavaDoc DIRECTORY_PANE
145             = new AccessibleRole JavaDoc("directorypane");
146
147     /**
148      * A specialized dialog that displays the files in the directory
149      * and lets the user select a file, browse a different directory,
150      * or specify a filename. May use the directory pane to show the
151      * contents of a directory.
152      * @see #DIRECTORY_PANE
153      */

154     public static final AccessibleRole JavaDoc FILE_CHOOSER
155             = new AccessibleRole JavaDoc("filechooser");
156
157     /**
158      * An object that fills up space in a user interface. It is often
159      * used in interfaces to tweak the spacing between components,
160      * but serves no other purpose.
161      */

162     public static final AccessibleRole JavaDoc FILLER
163             = new AccessibleRole JavaDoc("filler");
164
165     /**
166      * A hypertext anchor
167      */

168     public static final AccessibleRole JavaDoc HYPERLINK
169         = new AccessibleRole JavaDoc("hyperlink");
170
171     /**
172      * A small fixed size picture, typically used to decorate components.
173      */

174     public static final AccessibleRole JavaDoc ICON
175         = new AccessibleRole JavaDoc("icon");
176
177     /**
178      * An object used to present an icon or short string in an interface.
179      */

180     public static final AccessibleRole JavaDoc LABEL
181             = new AccessibleRole JavaDoc("label");
182
183     /**
184      * A specialized pane that has a glass pane and a layered pane as its
185      * children.
186      * @see #GLASS_PANE
187      * @see #LAYERED_PANE
188      */

189     public static final AccessibleRole JavaDoc ROOT_PANE
190             = new AccessibleRole JavaDoc("rootpane");
191
192     /**
193      * A pane that is guaranteed to be painted on top
194      * of all panes beneath it.
195      * @see #ROOT_PANE
196      * @see #CANVAS
197      */

198     public static final AccessibleRole JavaDoc GLASS_PANE
199             = new AccessibleRole JavaDoc("glasspane");
200
201     /**
202      * A specialized pane that allows its children to be drawn in layers,
203      * providing a form of stacking order. This is usually the pane that
204      * holds the menu bar as well as the pane that contains most of the
205      * visual components in a window.
206      * @see #GLASS_PANE
207      * @see #ROOT_PANE
208      */

209     public static final AccessibleRole JavaDoc LAYERED_PANE
210             = new AccessibleRole JavaDoc("layeredpane");
211
212     /**
213      * An object that presents a list of objects to the user and allows the
214      * user to select one or more of them. A list is usually contained
215      * within a scroll pane.
216      * @see #SCROLL_PANE
217      * @see #LIST_ITEM
218      */

219     public static final AccessibleRole JavaDoc LIST
220             = new AccessibleRole JavaDoc("list");
221
222     /**
223      * An object that presents an element in a list. A list is usually
224      * contained within a scroll pane.
225      * @see #SCROLL_PANE
226      * @see #LIST
227      */

228     public static final AccessibleRole JavaDoc LIST_ITEM
229             = new AccessibleRole JavaDoc("listitem");
230
231     /**
232      * An object usually drawn at the top of the primary dialog box of
233      * an application that contains a list of menus the user can choose
234      * from. For example, a menu bar might contain menus for "File,"
235      * "Edit," and "Help."
236      * @see #MENU
237      * @see #POPUP_MENU
238      * @see #LAYERED_PANE
239      */

240     public static final AccessibleRole JavaDoc MENU_BAR
241             = new AccessibleRole JavaDoc("menubar");
242
243     /**
244      * A temporary window that is usually used to offer the user a
245      * list of choices, and then hides when the user selects one of
246      * those choices.
247      * @see #MENU
248      * @see #MENU_ITEM
249      */

250     public static final AccessibleRole JavaDoc POPUP_MENU
251             = new AccessibleRole JavaDoc("popupmenu");
252
253     /**
254      * An object usually found inside a menu bar that contains a list
255      * of actions the user can choose from. A menu can have any object
256      * as its children, but most often they are menu items, other menus,
257      * or rudimentary objects such as radio buttons, check boxes, or
258      * separators. For example, an application may have an "Edit" menu
259      * that contains menu items for "Cut" and "Paste."
260      * @see #MENU_BAR
261      * @see #MENU_ITEM
262      * @see #SEPARATOR
263      * @see #RADIO_BUTTON
264      * @see #CHECK_BOX
265      * @see #POPUP_MENU
266      */

267     public static final AccessibleRole JavaDoc MENU
268             = new AccessibleRole JavaDoc("menu");
269
270     /**
271      * An object usually contained in a menu that presents an action
272      * the user can choose. For example, the "Cut" menu item in an
273      * "Edit" menu would be an action the user can select to cut the
274      * selected area of text in a document.
275      * @see #MENU_BAR
276      * @see #SEPARATOR
277      * @see #POPUP_MENU
278      */

279     public static final AccessibleRole JavaDoc MENU_ITEM
280             = new AccessibleRole JavaDoc("menuitem");
281
282     /**
283      * An object usually contained in a menu to provide a visual
284      * and logical separation of the contents in a menu. For example,
285      * the "File" menu of an application might contain menu items for
286      * "Open," "Close," and "Exit," and will place a separator between
287      * "Close" and "Exit" menu items.
288      * @see #MENU
289      * @see #MENU_ITEM
290      */

291     public static final AccessibleRole JavaDoc SEPARATOR
292             = new AccessibleRole JavaDoc("separator");
293
294     /**
295      * An object that presents a series of panels (or page tabs), one at a
296      * time, through some mechanism provided by the object. The most common
297      * mechanism is a list of tabs at the top of the panel. The children of
298      * a page tab list are all page tabs.
299      * @see #PAGE_TAB
300      */

301     public static final AccessibleRole JavaDoc PAGE_TAB_LIST
302             = new AccessibleRole JavaDoc("pagetablist");
303
304     /**
305      * An object that is a child of a page tab list. Its sole child is
306      * the panel that is to be presented to the user when the user
307      * selects the page tab from the list of tabs in the page tab list.
308      * @see #PAGE_TAB_LIST
309      */

310     public static final AccessibleRole JavaDoc PAGE_TAB
311             = new AccessibleRole JavaDoc("pagetab");
312
313     /**
314      * A generic container that is often used to group objects.
315      */

316     public static final AccessibleRole JavaDoc PANEL
317             = new AccessibleRole JavaDoc("panel");
318
319     /**
320      * An object used to indicate how much of a task has been completed.
321      */

322     public static final AccessibleRole JavaDoc PROGRESS_BAR
323             = new AccessibleRole JavaDoc("progressbar");
324
325     /**
326      * A text object used for passwords, or other places where the
327      * text contents is not shown visibly to the user
328      */

329     public static final AccessibleRole JavaDoc PASSWORD_TEXT
330             = new AccessibleRole JavaDoc("passwordtext");
331
332     /**
333      * An object the user can manipulate to tell the application to do
334      * something.
335      * @see #CHECK_BOX
336      * @see #TOGGLE_BUTTON
337      * @see #RADIO_BUTTON
338      */

339     public static final AccessibleRole JavaDoc PUSH_BUTTON
340             = new AccessibleRole JavaDoc("pushbutton");
341   
342     /**
343      * A specialized push button that can be checked or unchecked, but
344      * does not provide a separate indicator for the current state.
345      * @see #PUSH_BUTTON
346      * @see #CHECK_BOX
347      * @see #RADIO_BUTTON
348      */

349     public static final AccessibleRole JavaDoc TOGGLE_BUTTON
350             = new AccessibleRole JavaDoc("togglebutton");
351
352     /**
353      * A choice that can be checked or unchecked and provides a
354      * separate indicator for the current state.
355      * @see #PUSH_BUTTON
356      * @see #TOGGLE_BUTTON
357      * @see #RADIO_BUTTON
358      */

359     public static final AccessibleRole JavaDoc CHECK_BOX
360             = new AccessibleRole JavaDoc("checkbox");
361
362     /**
363      * A specialized check box that will cause other radio buttons in the
364      * same group to become unchecked when this one is checked.
365      * @see #PUSH_BUTTON
366      * @see #TOGGLE_BUTTON
367      * @see #CHECK_BOX
368      */

369     public static final AccessibleRole JavaDoc RADIO_BUTTON
370             = new AccessibleRole JavaDoc("radiobutton");
371
372     /**
373      * The header for a row of data.
374      */

375     public static final AccessibleRole JavaDoc ROW_HEADER
376             = new AccessibleRole JavaDoc("rowheader");
377
378     /**
379      * An object that allows a user to incrementally view a large amount
380      * of information. Its children can include scroll bars and a viewport.
381      * @see #SCROLL_BAR
382      * @see #VIEWPORT
383      */

384     public static final AccessibleRole JavaDoc SCROLL_PANE
385             = new AccessibleRole JavaDoc("scrollpane");
386
387     /**
388      * An object usually used to allow a user to incrementally view a
389      * large amount of data. Usually used only by a scroll pane.
390      * @see #SCROLL_PANE
391      */

392     public static final AccessibleRole JavaDoc SCROLL_BAR
393             = new AccessibleRole JavaDoc("scrollbar");
394
395     /**
396      * An object usually used in a scroll pane. It represents the portion
397      * of the entire data that the user can see. As the user manipulates
398      * the scroll bars, the contents of the viewport can change.
399      * @see #SCROLL_PANE
400      */

401     public static final AccessibleRole JavaDoc VIEWPORT
402             = new AccessibleRole JavaDoc("viewport");
403
404     /**
405      * An object that allows the user to select from a bounded range. For
406      * example, a slider might be used to select a number between 0 and 100.
407      */

408     public static final AccessibleRole JavaDoc SLIDER
409             = new AccessibleRole JavaDoc("slider");
410
411     /**
412      * A specialized panel that presents two other panels at the same time.
413      * Between the two panels is a divider the user can manipulate to make
414      * one panel larger and the other panel smaller.
415      */

416     public static final AccessibleRole JavaDoc SPLIT_PANE
417             = new AccessibleRole JavaDoc("splitpane");
418
419     /**
420      * An object used to present information in terms of rows and columns.
421      * An example might include a spreadsheet application.
422      */

423     public static final AccessibleRole JavaDoc TABLE
424             = new AccessibleRole JavaDoc("table");
425
426     /**
427      * An object that presents text to the user. The text is usually
428      * editable by the user as opposed to a label.
429      * @see #LABEL
430      */

431     public static final AccessibleRole JavaDoc TEXT
432             = new AccessibleRole JavaDoc("text");
433
434     /**
435      * An object used to present hierarchical information to the user.
436      * The individual nodes in the tree can be collapsed and expanded
437      * to provide selective disclosure of the tree's contents.
438      */

439     public static final AccessibleRole JavaDoc TREE
440             = new AccessibleRole JavaDoc("tree");
441
442     /**
443      * A bar or palette usually composed of push buttons or toggle buttons.
444      * It is often used to provide the most frequently used functions for an
445      * application.
446      */

447     public static final AccessibleRole JavaDoc TOOL_BAR
448             = new AccessibleRole JavaDoc("toolbar");
449
450     /**
451      * An object that provides information about another object. The
452      * accessibleDescription property of the tool tip is often displayed
453      * to the user in a small "help bubble" when the user causes the
454      * mouse to hover over the object associated with the tool tip.
455      */

456     public static final AccessibleRole JavaDoc TOOL_TIP
457             = new AccessibleRole JavaDoc("tooltip");
458
459     /**
460      * An AWT component, but nothing else is known about it.
461      * @see #SWING_COMPONENT
462      * @see #UNKNOWN
463      */

464     public static final AccessibleRole JavaDoc AWT_COMPONENT
465             = new AccessibleRole JavaDoc("awtcomponent");
466
467     /**
468      * A Swing component, but nothing else is known about it.
469      * @see #AWT_COMPONENT
470      * @see #UNKNOWN
471      */

472     public static final AccessibleRole JavaDoc SWING_COMPONENT
473             = new AccessibleRole JavaDoc("swingcomponent");
474
475     /**
476      * The object contains some Accessible information, but its role is
477      * not known.
478      * @see #AWT_COMPONENT
479      * @see #SWING_COMPONENT
480      */

481     public static final AccessibleRole JavaDoc UNKNOWN
482             = new AccessibleRole JavaDoc("unknown");
483
484     /**
485      * A STATUS_BAR is an simple component that can contain
486      * multiple labels of status information to the user.
487      */

488     public static final AccessibleRole JavaDoc STATUS_BAR
489     = new AccessibleRole JavaDoc("statusbar");
490     
491     /**
492      * A DATE_EDITOR is a component that allows users to edit
493      * java.util.Date and java.util.Time objects
494      */

495     public static final AccessibleRole JavaDoc DATE_EDITOR
496     = new AccessibleRole JavaDoc("dateeditor");
497     
498     /**
499      * A SPIN_BOX is a simple spinner component and its main use
500      * is for simple numbers.
501      */

502     public static final AccessibleRole JavaDoc SPIN_BOX
503     = new AccessibleRole JavaDoc("spinbox");
504     
505     /**
506      * A FONT_CHOOSER is a component that lets the user pick various
507      * attributes for fonts.
508      */

509     public static final AccessibleRole JavaDoc FONT_CHOOSER
510     = new AccessibleRole JavaDoc("fontchooser");
511     
512     /**
513      * A GROUP_BOX is a simple container that contains a border
514      * around it and contains components inside it.
515      */

516     public static final AccessibleRole JavaDoc GROUP_BOX
517     = new AccessibleRole JavaDoc("groupbox");
518
519     /**
520      * A text header
521      *
522      * @since 1.5
523      */

524     public static final AccessibleRole JavaDoc HEADER =
525         new AccessibleRole JavaDoc("header");
526  
527     /**
528      * A text footer
529      *
530      * @since 1.5
531      */

532     public static final AccessibleRole JavaDoc FOOTER =
533         new AccessibleRole JavaDoc("footer");
534  
535     /**
536      * A text paragraph
537      *
538      * @since 1.5
539      */

540     public static final AccessibleRole JavaDoc PARAGRAPH =
541         new AccessibleRole JavaDoc("paragraph");
542  
543     /**
544      * A ruler is an object used to measure distance
545      *
546      * @since 1.5
547      */

548     public static final AccessibleRole JavaDoc RULER =
549         new AccessibleRole JavaDoc("ruler");
550  
551     /**
552      * A role indicating the object acts as a formula for
553      * calculating a value. An example is a formula in
554      * a spreadsheet cell.
555      *
556      * @since 1.5
557      */

558     static public final AccessibleRole JavaDoc EDITBAR =
559         new AccessibleRole JavaDoc("editbar");
560
561     /**
562      * A role indicating the object monitors the progress
563      * of some operation.
564      *
565      * @since 1.5
566      */

567     static public final AccessibleRole JavaDoc PROGRESS_MONITOR =
568         new AccessibleRole JavaDoc("progressMonitor");
569
570
571 // The following are all under consideration for potential future use.
572

573 // public static final AccessibleRole APPLICATION
574
// = new AccessibleRole("application");
575

576 // public static final AccessibleRole BORDER
577
// = new AccessibleRole("border");
578

579 // public static final AccessibleRole CHECK_BOX_MENU_ITEM
580
// = new AccessibleRole("checkboxmenuitem");
581

582 // public static final AccessibleRole CHOICE
583
// = new AccessibleRole("choice");
584

585 // public static final AccessibleRole COLUMN
586
// = new AccessibleRole("column");
587

588 // public static final AccessibleRole CURSOR
589
// = new AccessibleRole("cursor");
590

591 // public static final AccessibleRole DOCUMENT
592
// = new AccessibleRole("document");
593

594 // public static final AccessibleRole IMAGE
595
// = new AccessibleRole("Image");
596

597 // public static final AccessibleRole INDICATOR
598
// = new AccessibleRole("indicator");
599

600 // public static final AccessibleRole RADIO_BUTTON_MENU_ITEM
601
// = new AccessibleRole("radiobuttonmenuitem");
602

603 // public static final AccessibleRole ROW
604
// = new AccessibleRole("row");
605

606 // public static final AccessibleRole TABLE_CELL
607
// = new AccessibleRole("tablecell");
608

609 // public static final AccessibleRole TREE_NODE
610
// = new AccessibleRole("treenode");
611

612     /**
613      * Creates a new AccessibleRole using the given locale independent key.
614      * This should not be a public method. Instead, it is used to create
615      * the constants in this file to make it a strongly typed enumeration.
616      * Subclasses of this class should enforce similar policy.
617      * <p>
618      * The key String should be a locale independent key for the role.
619      * It is not intended to be used as the actual String to display
620      * to the user. To get the localized string, use toDisplayString.
621      *
622      * @param key the locale independent name of the role.
623      * @see AccessibleBundle#toDisplayString
624      */

625     protected AccessibleRole(String JavaDoc key) {
626         this.key = key;
627     }
628 }
629
630
Popular Tags