Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java
41153 views
1
/*
2
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package javax.accessibility;
27
28
/**
29
* Class {@code AccessibleRole} determines the role of a component. The role of
30
* a component describes its generic function. (E.G., "push button," "table," or
31
* "list.")
32
* <p>
33
* The {@link #toDisplayString()} method allows you to obtain the localized
34
* string for a locale independent key from a predefined {@code ResourceBundle}
35
* for the keys defined in this class.
36
* <p>
37
* The constants in this class present a strongly typed enumeration of common
38
* object roles. A public constructor for this class has been purposely omitted
39
* and applications should use one of the constants from this class. If the
40
* constants in this class are not sufficient to describe the role of an object,
41
* a subclass should be generated from this class and it should provide
42
* constants in a similar manner.
43
*
44
* @author Willie Walker
45
* @author Peter Korn
46
* @author Lynn Monsanto
47
*/
48
public class AccessibleRole extends AccessibleBundle {
49
50
// If you add or remove anything from here, make sure you
51
// update AccessibleResourceBundle.java.
52
53
/**
54
* Object is used to alert the user about something.
55
*/
56
public static final AccessibleRole ALERT
57
= new AccessibleRole("alert");
58
59
/**
60
* The header for a column of data.
61
*/
62
public static final AccessibleRole COLUMN_HEADER
63
= new AccessibleRole("columnheader");
64
65
/**
66
* Object that can be drawn into and is used to trap events.
67
*
68
* @see #FRAME
69
* @see #GLASS_PANE
70
* @see #LAYERED_PANE
71
*/
72
public static final AccessibleRole CANVAS
73
= new AccessibleRole("canvas");
74
75
/**
76
* A list of choices the user can select from. Also optionally allows the
77
* user to enter a choice of their own.
78
*/
79
public static final AccessibleRole COMBO_BOX
80
= new AccessibleRole("combobox");
81
82
/**
83
* An iconified internal frame in a {@code DESKTOP_PANE}.
84
*
85
* @see #DESKTOP_PANE
86
* @see #INTERNAL_FRAME
87
*/
88
public static final AccessibleRole DESKTOP_ICON
89
= new AccessibleRole("desktopicon");
90
91
/**
92
* An object containing a collection of {@code Accessibles} that together
93
* represents {@code HTML} content. The child {@code Accessibles} would
94
* include objects implementing {@code AccessibleText},
95
* {@code AccessibleHypertext}, {@code AccessibleIcon}, and other
96
* interfaces.
97
*
98
* @see #HYPERLINK
99
* @see AccessibleText
100
* @see AccessibleHypertext
101
* @see AccessibleHyperlink
102
* @see AccessibleIcon
103
* @since 1.6
104
*/
105
public static final AccessibleRole HTML_CONTAINER
106
= new AccessibleRole("htmlcontainer");
107
108
/**
109
* A frame-like object that is clipped by a desktop pane. The desktop pane,
110
* internal frame, and desktop icon objects are often used to create
111
* multiple document interfaces within an application.
112
*
113
* @see #DESKTOP_ICON
114
* @see #DESKTOP_PANE
115
* @see #FRAME
116
*/
117
public static final AccessibleRole INTERNAL_FRAME
118
= new AccessibleRole("internalframe");
119
120
/**
121
* A pane that supports internal frames and iconified versions of those
122
* internal frames.
123
*
124
* @see #DESKTOP_ICON
125
* @see #INTERNAL_FRAME
126
*/
127
public static final AccessibleRole DESKTOP_PANE
128
= new AccessibleRole("desktoppane");
129
130
/**
131
* A specialized pane whose primary use is inside a {@code DIALOG}.
132
*
133
* @see #DIALOG
134
*/
135
public static final AccessibleRole OPTION_PANE
136
= new AccessibleRole("optionpane");
137
138
/**
139
* A top level window with no title or border.
140
*
141
* @see #FRAME
142
* @see #DIALOG
143
*/
144
public static final AccessibleRole WINDOW
145
= new AccessibleRole("window");
146
147
/**
148
* A top level window with a title bar, border, menu bar, etc. It is often
149
* used as the primary window for an application.
150
*
151
* @see #DIALOG
152
* @see #CANVAS
153
* @see #WINDOW
154
*/
155
public static final AccessibleRole FRAME
156
= new AccessibleRole("frame");
157
158
/**
159
* A top level window with title bar and a border. A dialog is similar to a
160
* frame, but it has fewer properties and is often used as a secondary
161
* window for an application.
162
*
163
* @see #FRAME
164
* @see #WINDOW
165
*/
166
public static final AccessibleRole DIALOG
167
= new AccessibleRole("dialog");
168
169
/**
170
* A specialized pane that lets the user choose a color.
171
*/
172
public static final AccessibleRole COLOR_CHOOSER
173
= new AccessibleRole("colorchooser");
174
175
176
/**
177
* A pane that allows the user to navigate through and select the contents
178
* of a directory. May be used by a file chooser.
179
*
180
* @see #FILE_CHOOSER
181
*/
182
public static final AccessibleRole DIRECTORY_PANE
183
= new AccessibleRole("directorypane");
184
185
/**
186
* A specialized dialog that displays the files in the directory and lets
187
* the user select a file, browse a different directory, or specify a
188
* filename. May use the directory pane to show the contents of a directory.
189
*
190
* @see #DIRECTORY_PANE
191
*/
192
public static final AccessibleRole FILE_CHOOSER
193
= new AccessibleRole("filechooser");
194
195
/**
196
* An object that fills up space in a user interface. It is often used in
197
* interfaces to tweak the spacing between components, but serves no other
198
* purpose.
199
*/
200
public static final AccessibleRole FILLER
201
= new AccessibleRole("filler");
202
203
/**
204
* A hypertext anchor.
205
*/
206
public static final AccessibleRole HYPERLINK
207
= new AccessibleRole("hyperlink");
208
209
/**
210
* A small fixed size picture, typically used to decorate components.
211
*/
212
public static final AccessibleRole ICON
213
= new AccessibleRole("icon");
214
215
/**
216
* An object used to present an icon or short string in an interface.
217
*/
218
public static final AccessibleRole LABEL
219
= new AccessibleRole("label");
220
221
/**
222
* A specialized pane that has a glass pane and a layered pane as its
223
* children.
224
*
225
* @see #GLASS_PANE
226
* @see #LAYERED_PANE
227
*/
228
public static final AccessibleRole ROOT_PANE
229
= new AccessibleRole("rootpane");
230
231
/**
232
* A pane that is guaranteed to be painted on top of all panes beneath it.
233
*
234
* @see #ROOT_PANE
235
* @see #CANVAS
236
*/
237
public static final AccessibleRole GLASS_PANE
238
= new AccessibleRole("glasspane");
239
240
/**
241
* A specialized pane that allows its children to be drawn in layers,
242
* providing a form of stacking order. This is usually the pane that holds
243
* the menu bar as well as the pane that contains most of the visual
244
* components in a window.
245
*
246
* @see #GLASS_PANE
247
* @see #ROOT_PANE
248
*/
249
public static final AccessibleRole LAYERED_PANE
250
= new AccessibleRole("layeredpane");
251
252
/**
253
* An object that presents a list of objects to the user and allows the user
254
* to select one or more of them. A list is usually contained within a
255
* scroll pane.
256
*
257
* @see #SCROLL_PANE
258
* @see #LIST_ITEM
259
*/
260
public static final AccessibleRole LIST
261
= new AccessibleRole("list");
262
263
/**
264
* An object that presents an element in a list. A list is usually contained
265
* within a scroll pane.
266
*
267
* @see #SCROLL_PANE
268
* @see #LIST
269
*/
270
public static final AccessibleRole LIST_ITEM
271
= new AccessibleRole("listitem");
272
273
/**
274
* An object usually drawn at the top of the primary dialog box of an
275
* application that contains a list of menus the user can choose from. For
276
* example, a menu bar might contain menus for "File," "Edit," and "Help."
277
*
278
* @see #MENU
279
* @see #POPUP_MENU
280
* @see #LAYERED_PANE
281
*/
282
public static final AccessibleRole MENU_BAR
283
= new AccessibleRole("menubar");
284
285
/**
286
* A temporary window that is usually used to offer the user a list of
287
* choices, and then hides when the user selects one of those choices.
288
*
289
* @see #MENU
290
* @see #MENU_ITEM
291
*/
292
public static final AccessibleRole POPUP_MENU
293
= new AccessibleRole("popupmenu");
294
295
/**
296
* An object usually found inside a menu bar that contains a list of actions
297
* the user can choose from. A menu can have any object as its children, but
298
* most often they are menu items, other menus, or rudimentary objects such
299
* as radio buttons, check boxes, or separators. For example, an application
300
* may have an "Edit" menu that contains menu items for "Cut" and "Paste."
301
*
302
* @see #MENU_BAR
303
* @see #MENU_ITEM
304
* @see #SEPARATOR
305
* @see #RADIO_BUTTON
306
* @see #CHECK_BOX
307
* @see #POPUP_MENU
308
*/
309
public static final AccessibleRole MENU
310
= new AccessibleRole("menu");
311
312
/**
313
* An object usually contained in a menu that presents an action the user
314
* can choose. For example, the "Cut" menu item in an "Edit" menu would be
315
* an action the user can select to cut the selected area of text in a
316
* document.
317
*
318
* @see #MENU_BAR
319
* @see #SEPARATOR
320
* @see #POPUP_MENU
321
*/
322
public static final AccessibleRole MENU_ITEM
323
= new AccessibleRole("menuitem");
324
325
/**
326
* An object usually contained in a menu to provide a visual and logical
327
* separation of the contents in a menu. For example, the "File" menu of an
328
* application might contain menu items for "Open," "Close," and "Exit," and
329
* will place a separator between "Close" and "Exit" menu items.
330
*
331
* @see #MENU
332
* @see #MENU_ITEM
333
*/
334
public static final AccessibleRole SEPARATOR
335
= new AccessibleRole("separator");
336
337
/**
338
* An object that presents a series of panels (or page tabs), one at a time,
339
* through some mechanism provided by the object. The most common mechanism
340
* is a list of tabs at the top of the panel. The children of a page tab
341
* list are all page tabs.
342
*
343
* @see #PAGE_TAB
344
*/
345
public static final AccessibleRole PAGE_TAB_LIST
346
= new AccessibleRole("pagetablist");
347
348
/**
349
* An object that is a child of a page tab list. Its sole child is the panel
350
* that is to be presented to the user when the user selects the page tab
351
* from the list of tabs in the page tab list.
352
*
353
* @see #PAGE_TAB_LIST
354
*/
355
public static final AccessibleRole PAGE_TAB
356
= new AccessibleRole("pagetab");
357
358
/**
359
* A generic container that is often used to group objects.
360
*/
361
public static final AccessibleRole PANEL
362
= new AccessibleRole("panel");
363
364
/**
365
* An object used to indicate how much of a task has been completed.
366
*/
367
public static final AccessibleRole PROGRESS_BAR
368
= new AccessibleRole("progressbar");
369
370
/**
371
* A text object used for passwords, or other places where the text contents
372
* is not shown visibly to the user.
373
*/
374
public static final AccessibleRole PASSWORD_TEXT
375
= new AccessibleRole("passwordtext");
376
377
/**
378
* An object the user can manipulate to tell the application to do
379
* something.
380
*
381
* @see #CHECK_BOX
382
* @see #TOGGLE_BUTTON
383
* @see #RADIO_BUTTON
384
*/
385
public static final AccessibleRole PUSH_BUTTON
386
= new AccessibleRole("pushbutton");
387
388
/**
389
* A specialized push button that can be checked or unchecked, but does not
390
* provide a separate indicator for the current state.
391
*
392
* @see #PUSH_BUTTON
393
* @see #CHECK_BOX
394
* @see #RADIO_BUTTON
395
*/
396
public static final AccessibleRole TOGGLE_BUTTON
397
= new AccessibleRole("togglebutton");
398
399
/**
400
* A choice that can be checked or unchecked and provides a separate
401
* indicator for the current state.
402
*
403
* @see #PUSH_BUTTON
404
* @see #TOGGLE_BUTTON
405
* @see #RADIO_BUTTON
406
*/
407
public static final AccessibleRole CHECK_BOX
408
= new AccessibleRole("checkbox");
409
410
/**
411
* A specialized check box that will cause other radio buttons in the same
412
* group to become unchecked when this one is checked.
413
*
414
* @see #PUSH_BUTTON
415
* @see #TOGGLE_BUTTON
416
* @see #CHECK_BOX
417
*/
418
public static final AccessibleRole RADIO_BUTTON
419
= new AccessibleRole("radiobutton");
420
421
/**
422
* The header for a row of data.
423
*/
424
public static final AccessibleRole ROW_HEADER
425
= new AccessibleRole("rowheader");
426
427
/**
428
* An object that allows a user to incrementally view a large amount of
429
* information. Its children can include scroll bars and a viewport.
430
*
431
* @see #SCROLL_BAR
432
* @see #VIEWPORT
433
*/
434
public static final AccessibleRole SCROLL_PANE
435
= new AccessibleRole("scrollpane");
436
437
/**
438
* An object usually used to allow a user to incrementally view a large
439
* amount of data. Usually used only by a scroll pane.
440
*
441
* @see #SCROLL_PANE
442
*/
443
public static final AccessibleRole SCROLL_BAR
444
= new AccessibleRole("scrollbar");
445
446
/**
447
* An object usually used in a scroll pane. It represents the portion of the
448
* entire data that the user can see. As the user manipulates the scroll
449
* bars, the contents of the viewport can change.
450
*
451
* @see #SCROLL_PANE
452
*/
453
public static final AccessibleRole VIEWPORT
454
= new AccessibleRole("viewport");
455
456
/**
457
* An object that allows the user to select from a bounded range. For
458
* example, a slider might be used to select a number between 0 and 100.
459
*/
460
public static final AccessibleRole SLIDER
461
= new AccessibleRole("slider");
462
463
/**
464
* A specialized panel that presents two other panels at the same time.
465
* Between the two panels is a divider the user can manipulate to make one
466
* panel larger and the other panel smaller.
467
*/
468
public static final AccessibleRole SPLIT_PANE
469
= new AccessibleRole("splitpane");
470
471
/**
472
* An object used to present information in terms of rows and columns. An
473
* example might include a spreadsheet application.
474
*/
475
public static final AccessibleRole TABLE
476
= new AccessibleRole("table");
477
478
/**
479
* An object that presents text to the user. The text is usually editable by
480
* the user as opposed to a label.
481
*
482
* @see #LABEL
483
*/
484
public static final AccessibleRole TEXT
485
= new AccessibleRole("text");
486
487
/**
488
* An object used to present hierarchical information to the user. The
489
* individual nodes in the tree can be collapsed and expanded to provide
490
* selective disclosure of the tree's contents.
491
*/
492
public static final AccessibleRole TREE
493
= new AccessibleRole("tree");
494
495
/**
496
* A bar or palette usually composed of push buttons or toggle buttons. It
497
* is often used to provide the most frequently used functions for an
498
* application.
499
*/
500
public static final AccessibleRole TOOL_BAR
501
= new AccessibleRole("toolbar");
502
503
/**
504
* An object that provides information about another object. The
505
* {@code accessibleDescription} property of the tool tip is often displayed
506
* to the user in a small "help bubble" when the user causes the mouse to
507
* hover over the object associated with the tool tip.
508
*/
509
public static final AccessibleRole TOOL_TIP
510
= new AccessibleRole("tooltip");
511
512
/**
513
* An AWT component, but nothing else is known about it.
514
*
515
* @see #SWING_COMPONENT
516
* @see #UNKNOWN
517
*/
518
public static final AccessibleRole AWT_COMPONENT
519
= new AccessibleRole("awtcomponent");
520
521
/**
522
* A Swing component, but nothing else is known about it.
523
*
524
* @see #AWT_COMPONENT
525
* @see #UNKNOWN
526
*/
527
public static final AccessibleRole SWING_COMPONENT
528
= new AccessibleRole("swingcomponent");
529
530
/**
531
* The object contains some {@code Accessible} information, but its role is
532
* not known.
533
*
534
* @see #AWT_COMPONENT
535
* @see #SWING_COMPONENT
536
*/
537
public static final AccessibleRole UNKNOWN
538
= new AccessibleRole("unknown");
539
540
/**
541
* A {@code STATUS_BAR} is an simple component that can contain multiple
542
* labels of status information to the user.
543
*/
544
public static final AccessibleRole STATUS_BAR
545
= new AccessibleRole("statusbar");
546
547
/**
548
* A {@code DATE_EDITOR} is a component that allows users to edit
549
* {@code java.util.Date} and {@code java.util.Time} objects.
550
*/
551
public static final AccessibleRole DATE_EDITOR
552
= new AccessibleRole("dateeditor");
553
554
/**
555
* A {@code SPIN_BOX} is a simple spinner component and its main use is for
556
* simple numbers.
557
*/
558
public static final AccessibleRole SPIN_BOX
559
= new AccessibleRole("spinbox");
560
561
/**
562
* A {@code FONT_CHOOSER} is a component that lets the user pick various
563
* attributes for fonts.
564
*/
565
public static final AccessibleRole FONT_CHOOSER
566
= new AccessibleRole("fontchooser");
567
568
/**
569
* A {@code GROUP_BOX} is a simple container that contains a border around
570
* it and contains components inside it.
571
*/
572
public static final AccessibleRole GROUP_BOX
573
= new AccessibleRole("groupbox");
574
575
/**
576
* A text header.
577
*
578
* @since 1.5
579
*/
580
public static final AccessibleRole HEADER =
581
new AccessibleRole("header");
582
583
/**
584
* A text footer.
585
*
586
* @since 1.5
587
*/
588
public static final AccessibleRole FOOTER =
589
new AccessibleRole("footer");
590
591
/**
592
* A text paragraph.
593
*
594
* @since 1.5
595
*/
596
public static final AccessibleRole PARAGRAPH =
597
new AccessibleRole("paragraph");
598
599
/**
600
* A ruler is an object used to measure distance.
601
*
602
* @since 1.5
603
*/
604
public static final AccessibleRole RULER =
605
new AccessibleRole("ruler");
606
607
/**
608
* A role indicating the object acts as a formula for calculating a value.
609
* An example is a formula in a spreadsheet cell.
610
*
611
* @since 1.5
612
*/
613
public static final AccessibleRole EDITBAR =
614
new AccessibleRole("editbar");
615
616
/**
617
* A role indicating the object monitors the progress of some operation.
618
*
619
* @since 1.5
620
*/
621
public static final AccessibleRole PROGRESS_MONITOR =
622
new AccessibleRole("progressMonitor");
623
624
625
// The following are all under consideration for potential future use.
626
627
// public static final AccessibleRole APPLICATION
628
// = new AccessibleRole("application");
629
630
// public static final AccessibleRole BORDER
631
// = new AccessibleRole("border");
632
633
// public static final AccessibleRole CHECK_BOX_MENU_ITEM
634
// = new AccessibleRole("checkboxmenuitem");
635
636
// public static final AccessibleRole CHOICE
637
// = new AccessibleRole("choice");
638
639
// public static final AccessibleRole COLUMN
640
// = new AccessibleRole("column");
641
642
// public static final AccessibleRole CURSOR
643
// = new AccessibleRole("cursor");
644
645
// public static final AccessibleRole DOCUMENT
646
// = new AccessibleRole("document");
647
648
// public static final AccessibleRole IMAGE
649
// = new AccessibleRole("Image");
650
651
// public static final AccessibleRole INDICATOR
652
// = new AccessibleRole("indicator");
653
654
// public static final AccessibleRole RADIO_BUTTON_MENU_ITEM
655
// = new AccessibleRole("radiobuttonmenuitem");
656
657
// public static final AccessibleRole ROW
658
// = new AccessibleRole("row");
659
660
// public static final AccessibleRole TABLE_CELL
661
// = new AccessibleRole("tablecell");
662
663
// public static final AccessibleRole TREE_NODE
664
// = new AccessibleRole("treenode");
665
666
/**
667
* Creates a new {@code AccessibleRole} using the given locale independent
668
* key. This should not be a public method. Instead, it is used to create
669
* the constants in this file to make it a strongly typed enumeration.
670
* Subclasses of this class should enforce similar policy.
671
* <p>
672
* The key {@code String} should be a locale independent key for the role.
673
* It is not intended to be used as the actual {@code String} to display to
674
* the user. To get the localized string, use {@link #toDisplayString()}.
675
*
676
* @param key the locale independent name of the role
677
* @see AccessibleBundle#toDisplayString
678
*/
679
protected AccessibleRole(String key) {
680
this.key = key;
681
}
682
}
683
684