Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java
41153 views
/*1* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.accessibility;2627/**28* Class {@code AccessibleRole} determines the role of a component. The role of29* a component describes its generic function. (E.G., "push button," "table," or30* "list.")31* <p>32* The {@link #toDisplayString()} method allows you to obtain the localized33* string for a locale independent key from a predefined {@code ResourceBundle}34* for the keys defined in this class.35* <p>36* The constants in this class present a strongly typed enumeration of common37* object roles. A public constructor for this class has been purposely omitted38* and applications should use one of the constants from this class. If the39* constants in this class are not sufficient to describe the role of an object,40* a subclass should be generated from this class and it should provide41* constants in a similar manner.42*43* @author Willie Walker44* @author Peter Korn45* @author Lynn Monsanto46*/47public class AccessibleRole extends AccessibleBundle {4849// If you add or remove anything from here, make sure you50// update AccessibleResourceBundle.java.5152/**53* Object is used to alert the user about something.54*/55public static final AccessibleRole ALERT56= new AccessibleRole("alert");5758/**59* The header for a column of data.60*/61public static final AccessibleRole COLUMN_HEADER62= new AccessibleRole("columnheader");6364/**65* Object that can be drawn into and is used to trap events.66*67* @see #FRAME68* @see #GLASS_PANE69* @see #LAYERED_PANE70*/71public static final AccessibleRole CANVAS72= new AccessibleRole("canvas");7374/**75* A list of choices the user can select from. Also optionally allows the76* user to enter a choice of their own.77*/78public static final AccessibleRole COMBO_BOX79= new AccessibleRole("combobox");8081/**82* An iconified internal frame in a {@code DESKTOP_PANE}.83*84* @see #DESKTOP_PANE85* @see #INTERNAL_FRAME86*/87public static final AccessibleRole DESKTOP_ICON88= new AccessibleRole("desktopicon");8990/**91* An object containing a collection of {@code Accessibles} that together92* represents {@code HTML} content. The child {@code Accessibles} would93* include objects implementing {@code AccessibleText},94* {@code AccessibleHypertext}, {@code AccessibleIcon}, and other95* interfaces.96*97* @see #HYPERLINK98* @see AccessibleText99* @see AccessibleHypertext100* @see AccessibleHyperlink101* @see AccessibleIcon102* @since 1.6103*/104public static final AccessibleRole HTML_CONTAINER105= new AccessibleRole("htmlcontainer");106107/**108* A frame-like object that is clipped by a desktop pane. The desktop pane,109* internal frame, and desktop icon objects are often used to create110* multiple document interfaces within an application.111*112* @see #DESKTOP_ICON113* @see #DESKTOP_PANE114* @see #FRAME115*/116public static final AccessibleRole INTERNAL_FRAME117= new AccessibleRole("internalframe");118119/**120* A pane that supports internal frames and iconified versions of those121* internal frames.122*123* @see #DESKTOP_ICON124* @see #INTERNAL_FRAME125*/126public static final AccessibleRole DESKTOP_PANE127= new AccessibleRole("desktoppane");128129/**130* A specialized pane whose primary use is inside a {@code DIALOG}.131*132* @see #DIALOG133*/134public static final AccessibleRole OPTION_PANE135= new AccessibleRole("optionpane");136137/**138* A top level window with no title or border.139*140* @see #FRAME141* @see #DIALOG142*/143public static final AccessibleRole WINDOW144= new AccessibleRole("window");145146/**147* A top level window with a title bar, border, menu bar, etc. It is often148* used as the primary window for an application.149*150* @see #DIALOG151* @see #CANVAS152* @see #WINDOW153*/154public static final AccessibleRole FRAME155= new AccessibleRole("frame");156157/**158* A top level window with title bar and a border. A dialog is similar to a159* frame, but it has fewer properties and is often used as a secondary160* window for an application.161*162* @see #FRAME163* @see #WINDOW164*/165public static final AccessibleRole DIALOG166= new AccessibleRole("dialog");167168/**169* A specialized pane that lets the user choose a color.170*/171public static final AccessibleRole COLOR_CHOOSER172= new AccessibleRole("colorchooser");173174175/**176* A pane that allows the user to navigate through and select the contents177* of a directory. May be used by a file chooser.178*179* @see #FILE_CHOOSER180*/181public static final AccessibleRole DIRECTORY_PANE182= new AccessibleRole("directorypane");183184/**185* A specialized dialog that displays the files in the directory and lets186* the user select a file, browse a different directory, or specify a187* filename. May use the directory pane to show the contents of a directory.188*189* @see #DIRECTORY_PANE190*/191public static final AccessibleRole FILE_CHOOSER192= new AccessibleRole("filechooser");193194/**195* An object that fills up space in a user interface. It is often used in196* interfaces to tweak the spacing between components, but serves no other197* purpose.198*/199public static final AccessibleRole FILLER200= new AccessibleRole("filler");201202/**203* A hypertext anchor.204*/205public static final AccessibleRole HYPERLINK206= new AccessibleRole("hyperlink");207208/**209* A small fixed size picture, typically used to decorate components.210*/211public static final AccessibleRole ICON212= new AccessibleRole("icon");213214/**215* An object used to present an icon or short string in an interface.216*/217public static final AccessibleRole LABEL218= new AccessibleRole("label");219220/**221* A specialized pane that has a glass pane and a layered pane as its222* children.223*224* @see #GLASS_PANE225* @see #LAYERED_PANE226*/227public static final AccessibleRole ROOT_PANE228= new AccessibleRole("rootpane");229230/**231* A pane that is guaranteed to be painted on top of all panes beneath it.232*233* @see #ROOT_PANE234* @see #CANVAS235*/236public static final AccessibleRole GLASS_PANE237= new AccessibleRole("glasspane");238239/**240* A specialized pane that allows its children to be drawn in layers,241* providing a form of stacking order. This is usually the pane that holds242* the menu bar as well as the pane that contains most of the visual243* components in a window.244*245* @see #GLASS_PANE246* @see #ROOT_PANE247*/248public static final AccessibleRole LAYERED_PANE249= new AccessibleRole("layeredpane");250251/**252* An object that presents a list of objects to the user and allows the user253* to select one or more of them. A list is usually contained within a254* scroll pane.255*256* @see #SCROLL_PANE257* @see #LIST_ITEM258*/259public static final AccessibleRole LIST260= new AccessibleRole("list");261262/**263* An object that presents an element in a list. A list is usually contained264* within a scroll pane.265*266* @see #SCROLL_PANE267* @see #LIST268*/269public static final AccessibleRole LIST_ITEM270= new AccessibleRole("listitem");271272/**273* An object usually drawn at the top of the primary dialog box of an274* application that contains a list of menus the user can choose from. For275* example, a menu bar might contain menus for "File," "Edit," and "Help."276*277* @see #MENU278* @see #POPUP_MENU279* @see #LAYERED_PANE280*/281public static final AccessibleRole MENU_BAR282= new AccessibleRole("menubar");283284/**285* A temporary window that is usually used to offer the user a list of286* choices, and then hides when the user selects one of those choices.287*288* @see #MENU289* @see #MENU_ITEM290*/291public static final AccessibleRole POPUP_MENU292= new AccessibleRole("popupmenu");293294/**295* An object usually found inside a menu bar that contains a list of actions296* the user can choose from. A menu can have any object as its children, but297* most often they are menu items, other menus, or rudimentary objects such298* as radio buttons, check boxes, or separators. For example, an application299* may have an "Edit" menu that contains menu items for "Cut" and "Paste."300*301* @see #MENU_BAR302* @see #MENU_ITEM303* @see #SEPARATOR304* @see #RADIO_BUTTON305* @see #CHECK_BOX306* @see #POPUP_MENU307*/308public static final AccessibleRole MENU309= new AccessibleRole("menu");310311/**312* An object usually contained in a menu that presents an action the user313* can choose. For example, the "Cut" menu item in an "Edit" menu would be314* an action the user can select to cut the selected area of text in a315* document.316*317* @see #MENU_BAR318* @see #SEPARATOR319* @see #POPUP_MENU320*/321public static final AccessibleRole MENU_ITEM322= new AccessibleRole("menuitem");323324/**325* An object usually contained in a menu to provide a visual and logical326* separation of the contents in a menu. For example, the "File" menu of an327* application might contain menu items for "Open," "Close," and "Exit," and328* will place a separator between "Close" and "Exit" menu items.329*330* @see #MENU331* @see #MENU_ITEM332*/333public static final AccessibleRole SEPARATOR334= new AccessibleRole("separator");335336/**337* An object that presents a series of panels (or page tabs), one at a time,338* through some mechanism provided by the object. The most common mechanism339* is a list of tabs at the top of the panel. The children of a page tab340* list are all page tabs.341*342* @see #PAGE_TAB343*/344public static final AccessibleRole PAGE_TAB_LIST345= new AccessibleRole("pagetablist");346347/**348* An object that is a child of a page tab list. Its sole child is the panel349* that is to be presented to the user when the user selects the page tab350* from the list of tabs in the page tab list.351*352* @see #PAGE_TAB_LIST353*/354public static final AccessibleRole PAGE_TAB355= new AccessibleRole("pagetab");356357/**358* A generic container that is often used to group objects.359*/360public static final AccessibleRole PANEL361= new AccessibleRole("panel");362363/**364* An object used to indicate how much of a task has been completed.365*/366public static final AccessibleRole PROGRESS_BAR367= new AccessibleRole("progressbar");368369/**370* A text object used for passwords, or other places where the text contents371* is not shown visibly to the user.372*/373public static final AccessibleRole PASSWORD_TEXT374= new AccessibleRole("passwordtext");375376/**377* An object the user can manipulate to tell the application to do378* something.379*380* @see #CHECK_BOX381* @see #TOGGLE_BUTTON382* @see #RADIO_BUTTON383*/384public static final AccessibleRole PUSH_BUTTON385= new AccessibleRole("pushbutton");386387/**388* A specialized push button that can be checked or unchecked, but does not389* provide a separate indicator for the current state.390*391* @see #PUSH_BUTTON392* @see #CHECK_BOX393* @see #RADIO_BUTTON394*/395public static final AccessibleRole TOGGLE_BUTTON396= new AccessibleRole("togglebutton");397398/**399* A choice that can be checked or unchecked and provides a separate400* indicator for the current state.401*402* @see #PUSH_BUTTON403* @see #TOGGLE_BUTTON404* @see #RADIO_BUTTON405*/406public static final AccessibleRole CHECK_BOX407= new AccessibleRole("checkbox");408409/**410* A specialized check box that will cause other radio buttons in the same411* group to become unchecked when this one is checked.412*413* @see #PUSH_BUTTON414* @see #TOGGLE_BUTTON415* @see #CHECK_BOX416*/417public static final AccessibleRole RADIO_BUTTON418= new AccessibleRole("radiobutton");419420/**421* The header for a row of data.422*/423public static final AccessibleRole ROW_HEADER424= new AccessibleRole("rowheader");425426/**427* An object that allows a user to incrementally view a large amount of428* information. Its children can include scroll bars and a viewport.429*430* @see #SCROLL_BAR431* @see #VIEWPORT432*/433public static final AccessibleRole SCROLL_PANE434= new AccessibleRole("scrollpane");435436/**437* An object usually used to allow a user to incrementally view a large438* amount of data. Usually used only by a scroll pane.439*440* @see #SCROLL_PANE441*/442public static final AccessibleRole SCROLL_BAR443= new AccessibleRole("scrollbar");444445/**446* An object usually used in a scroll pane. It represents the portion of the447* entire data that the user can see. As the user manipulates the scroll448* bars, the contents of the viewport can change.449*450* @see #SCROLL_PANE451*/452public static final AccessibleRole VIEWPORT453= new AccessibleRole("viewport");454455/**456* An object that allows the user to select from a bounded range. For457* example, a slider might be used to select a number between 0 and 100.458*/459public static final AccessibleRole SLIDER460= new AccessibleRole("slider");461462/**463* A specialized panel that presents two other panels at the same time.464* Between the two panels is a divider the user can manipulate to make one465* panel larger and the other panel smaller.466*/467public static final AccessibleRole SPLIT_PANE468= new AccessibleRole("splitpane");469470/**471* An object used to present information in terms of rows and columns. An472* example might include a spreadsheet application.473*/474public static final AccessibleRole TABLE475= new AccessibleRole("table");476477/**478* An object that presents text to the user. The text is usually editable by479* the user as opposed to a label.480*481* @see #LABEL482*/483public static final AccessibleRole TEXT484= new AccessibleRole("text");485486/**487* An object used to present hierarchical information to the user. The488* individual nodes in the tree can be collapsed and expanded to provide489* selective disclosure of the tree's contents.490*/491public static final AccessibleRole TREE492= new AccessibleRole("tree");493494/**495* A bar or palette usually composed of push buttons or toggle buttons. It496* is often used to provide the most frequently used functions for an497* application.498*/499public static final AccessibleRole TOOL_BAR500= new AccessibleRole("toolbar");501502/**503* An object that provides information about another object. The504* {@code accessibleDescription} property of the tool tip is often displayed505* to the user in a small "help bubble" when the user causes the mouse to506* hover over the object associated with the tool tip.507*/508public static final AccessibleRole TOOL_TIP509= new AccessibleRole("tooltip");510511/**512* An AWT component, but nothing else is known about it.513*514* @see #SWING_COMPONENT515* @see #UNKNOWN516*/517public static final AccessibleRole AWT_COMPONENT518= new AccessibleRole("awtcomponent");519520/**521* A Swing component, but nothing else is known about it.522*523* @see #AWT_COMPONENT524* @see #UNKNOWN525*/526public static final AccessibleRole SWING_COMPONENT527= new AccessibleRole("swingcomponent");528529/**530* The object contains some {@code Accessible} information, but its role is531* not known.532*533* @see #AWT_COMPONENT534* @see #SWING_COMPONENT535*/536public static final AccessibleRole UNKNOWN537= new AccessibleRole("unknown");538539/**540* A {@code STATUS_BAR} is an simple component that can contain multiple541* labels of status information to the user.542*/543public static final AccessibleRole STATUS_BAR544= new AccessibleRole("statusbar");545546/**547* A {@code DATE_EDITOR} is a component that allows users to edit548* {@code java.util.Date} and {@code java.util.Time} objects.549*/550public static final AccessibleRole DATE_EDITOR551= new AccessibleRole("dateeditor");552553/**554* A {@code SPIN_BOX} is a simple spinner component and its main use is for555* simple numbers.556*/557public static final AccessibleRole SPIN_BOX558= new AccessibleRole("spinbox");559560/**561* A {@code FONT_CHOOSER} is a component that lets the user pick various562* attributes for fonts.563*/564public static final AccessibleRole FONT_CHOOSER565= new AccessibleRole("fontchooser");566567/**568* A {@code GROUP_BOX} is a simple container that contains a border around569* it and contains components inside it.570*/571public static final AccessibleRole GROUP_BOX572= new AccessibleRole("groupbox");573574/**575* A text header.576*577* @since 1.5578*/579public static final AccessibleRole HEADER =580new AccessibleRole("header");581582/**583* A text footer.584*585* @since 1.5586*/587public static final AccessibleRole FOOTER =588new AccessibleRole("footer");589590/**591* A text paragraph.592*593* @since 1.5594*/595public static final AccessibleRole PARAGRAPH =596new AccessibleRole("paragraph");597598/**599* A ruler is an object used to measure distance.600*601* @since 1.5602*/603public static final AccessibleRole RULER =604new AccessibleRole("ruler");605606/**607* A role indicating the object acts as a formula for calculating a value.608* An example is a formula in a spreadsheet cell.609*610* @since 1.5611*/612public static final AccessibleRole EDITBAR =613new AccessibleRole("editbar");614615/**616* A role indicating the object monitors the progress of some operation.617*618* @since 1.5619*/620public static final AccessibleRole PROGRESS_MONITOR =621new AccessibleRole("progressMonitor");622623624// The following are all under consideration for potential future use.625626// public static final AccessibleRole APPLICATION627// = new AccessibleRole("application");628629// public static final AccessibleRole BORDER630// = new AccessibleRole("border");631632// public static final AccessibleRole CHECK_BOX_MENU_ITEM633// = new AccessibleRole("checkboxmenuitem");634635// public static final AccessibleRole CHOICE636// = new AccessibleRole("choice");637638// public static final AccessibleRole COLUMN639// = new AccessibleRole("column");640641// public static final AccessibleRole CURSOR642// = new AccessibleRole("cursor");643644// public static final AccessibleRole DOCUMENT645// = new AccessibleRole("document");646647// public static final AccessibleRole IMAGE648// = new AccessibleRole("Image");649650// public static final AccessibleRole INDICATOR651// = new AccessibleRole("indicator");652653// public static final AccessibleRole RADIO_BUTTON_MENU_ITEM654// = new AccessibleRole("radiobuttonmenuitem");655656// public static final AccessibleRole ROW657// = new AccessibleRole("row");658659// public static final AccessibleRole TABLE_CELL660// = new AccessibleRole("tablecell");661662// public static final AccessibleRole TREE_NODE663// = new AccessibleRole("treenode");664665/**666* Creates a new {@code AccessibleRole} using the given locale independent667* key. This should not be a public method. Instead, it is used to create668* the constants in this file to make it a strongly typed enumeration.669* Subclasses of this class should enforce similar policy.670* <p>671* The key {@code String} should be a locale independent key for the role.672* It is not intended to be used as the actual {@code String} to display to673* the user. To get the localized string, use {@link #toDisplayString()}.674*675* @param key the locale independent name of the role676* @see AccessibleBundle#toDisplayString677*/678protected AccessibleRole(String key) {679this.key = key;680}681}682683684