Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/accessibility/AccessibleRole.java
38829 views
/*1* Copyright (c) 1997, 2005, 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;2627import java.util.Locale;28import java.util.MissingResourceException;29import java.util.ResourceBundle;3031/**32* <P>Class AccessibleRole determines the role of a component. The role of a33* component describes its generic function. (E.G.,34* "push button," "table," or "list.")35* <p>The toDisplayString method allows you to obtain the localized string36* for a locale independent key from a predefined ResourceBundle for the37* keys defined in this class.38* <p>The constants in this class present a strongly typed enumeration39* of common object roles. A public constructor for this class has been40* purposely omitted and applications should use one of the constants41* from this class. If the constants in this class are not sufficient42* to describe the role of an object, a subclass should be generated43* from this class and it should provide constants in a similar manner.44*45* @author Willie Walker46* @author Peter Korn47* @author Lynn Monsanto48*/49public class AccessibleRole extends AccessibleBundle {5051// If you add or remove anything from here, make sure you52// update AccessibleResourceBundle.java.5354/**55* Object is used to alert the user about something.56*/57public static final AccessibleRole ALERT58= new AccessibleRole("alert");5960/**61* The header for a column of data.62*/63public static final AccessibleRole COLUMN_HEADER64= new AccessibleRole("columnheader");6566/**67* Object that can be drawn into and is used to trap68* events.69* @see #FRAME70* @see #GLASS_PANE71* @see #LAYERED_PANE72*/73public static final AccessibleRole CANVAS74= new AccessibleRole("canvas");7576/**77* A list of choices the user can select from. Also optionally78* allows the user to enter a choice of their own.79*/80public static final AccessibleRole COMBO_BOX81= new AccessibleRole("combobox");8283/**84* An iconified internal frame in a DESKTOP_PANE.85* @see #DESKTOP_PANE86* @see #INTERNAL_FRAME87*/88public static final AccessibleRole DESKTOP_ICON89= new AccessibleRole("desktopicon");9091/**92* An object containing a collection of <code>Accessibles</code> that93* together represents <code>HTML</code> content. The child94* <code>Accessibles</code> would include objects implementing95* <code>AccessibleText</code>, <code>AccessibleHypertext</code>,96* <code>AccessibleIcon</code>, and other interfaces.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. The109* desktop pane, internal frame, and desktop icon objects are110* often used to create multiple document interfaces within an111* application.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 and121* iconified versions of those internal frames.122* @see #DESKTOP_ICON123* @see #INTERNAL_FRAME124*/125public static final AccessibleRole DESKTOP_PANE126= new AccessibleRole("desktoppane");127128/**129* A specialized pane whose primary use is inside a DIALOG130* @see #DIALOG131*/132public static final AccessibleRole OPTION_PANE133= new AccessibleRole("optionpane");134135/**136* A top level window with no title or border.137* @see #FRAME138* @see #DIALOG139*/140public static final AccessibleRole WINDOW141= new AccessibleRole("window");142143/**144* A top level window with a title bar, border, menu bar, etc. It is145* often used as the primary window for an application.146* @see #DIALOG147* @see #CANVAS148* @see #WINDOW149*/150public static final AccessibleRole FRAME151= new AccessibleRole("frame");152153/**154* A top level window with title bar and a border. A dialog is similar155* to a frame, but it has fewer properties and is often used as a156* secondary window for an application.157* @see #FRAME158* @see #WINDOW159*/160public static final AccessibleRole DIALOG161= new AccessibleRole("dialog");162163/**164* A specialized pane that lets the user choose a color.165*/166public static final AccessibleRole COLOR_CHOOSER167= new AccessibleRole("colorchooser");168169170/**171* A pane that allows the user to navigate through172* and select the contents of a directory. May be used173* by a file chooser.174* @see #FILE_CHOOSER175*/176public static final AccessibleRole DIRECTORY_PANE177= new AccessibleRole("directorypane");178179/**180* A specialized dialog that displays the files in the directory181* and lets the user select a file, browse a different directory,182* or specify a filename. May use the directory pane to show the183* contents of a directory.184* @see #DIRECTORY_PANE185*/186public static final AccessibleRole FILE_CHOOSER187= new AccessibleRole("filechooser");188189/**190* An object that fills up space in a user interface. It is often191* used in interfaces to tweak the spacing between components,192* but serves no other purpose.193*/194public static final AccessibleRole FILLER195= new AccessibleRole("filler");196197/**198* A hypertext anchor199*/200public static final AccessibleRole HYPERLINK201= new AccessibleRole("hyperlink");202203/**204* A small fixed size picture, typically used to decorate components.205*/206public static final AccessibleRole ICON207= new AccessibleRole("icon");208209/**210* An object used to present an icon or short string in an interface.211*/212public static final AccessibleRole LABEL213= new AccessibleRole("label");214215/**216* A specialized pane that has a glass pane and a layered pane as its217* children.218* @see #GLASS_PANE219* @see #LAYERED_PANE220*/221public static final AccessibleRole ROOT_PANE222= new AccessibleRole("rootpane");223224/**225* A pane that is guaranteed to be painted on top226* of all panes beneath it.227* @see #ROOT_PANE228* @see #CANVAS229*/230public static final AccessibleRole GLASS_PANE231= new AccessibleRole("glasspane");232233/**234* A specialized pane that allows its children to be drawn in layers,235* providing a form of stacking order. This is usually the pane that236* holds the menu bar as well as the pane that contains most of the237* visual components in a window.238* @see #GLASS_PANE239* @see #ROOT_PANE240*/241public static final AccessibleRole LAYERED_PANE242= new AccessibleRole("layeredpane");243244/**245* An object that presents a list of objects to the user and allows the246* user to select one or more of them. A list is usually contained247* within a scroll pane.248* @see #SCROLL_PANE249* @see #LIST_ITEM250*/251public static final AccessibleRole LIST252= new AccessibleRole("list");253254/**255* An object that presents an element in a list. A list is usually256* contained within a scroll pane.257* @see #SCROLL_PANE258* @see #LIST259*/260public static final AccessibleRole LIST_ITEM261= new AccessibleRole("listitem");262263/**264* An object usually drawn at the top of the primary dialog box of265* an application that contains a list of menus the user can choose266* from. For example, a menu bar might contain menus for "File,"267* "Edit," and "Help."268* @see #MENU269* @see #POPUP_MENU270* @see #LAYERED_PANE271*/272public static final AccessibleRole MENU_BAR273= new AccessibleRole("menubar");274275/**276* A temporary window that is usually used to offer the user a277* list of choices, and then hides when the user selects one of278* those choices.279* @see #MENU280* @see #MENU_ITEM281*/282public static final AccessibleRole POPUP_MENU283= new AccessibleRole("popupmenu");284285/**286* An object usually found inside a menu bar that contains a list287* of actions the user can choose from. A menu can have any object288* as its children, but most often they are menu items, other menus,289* or rudimentary objects such as radio buttons, check boxes, or290* separators. For example, an application may have an "Edit" menu291* that contains menu items for "Cut" and "Paste."292* @see #MENU_BAR293* @see #MENU_ITEM294* @see #SEPARATOR295* @see #RADIO_BUTTON296* @see #CHECK_BOX297* @see #POPUP_MENU298*/299public static final AccessibleRole MENU300= new AccessibleRole("menu");301302/**303* An object usually contained in a menu that presents an action304* the user can choose. For example, the "Cut" menu item in an305* "Edit" menu would be an action the user can select to cut the306* selected area of text in a document.307* @see #MENU_BAR308* @see #SEPARATOR309* @see #POPUP_MENU310*/311public static final AccessibleRole MENU_ITEM312= new AccessibleRole("menuitem");313314/**315* An object usually contained in a menu to provide a visual316* and logical separation of the contents in a menu. For example,317* the "File" menu of an application might contain menu items for318* "Open," "Close," and "Exit," and will place a separator between319* "Close" and "Exit" menu items.320* @see #MENU321* @see #MENU_ITEM322*/323public static final AccessibleRole SEPARATOR324= new AccessibleRole("separator");325326/**327* An object that presents a series of panels (or page tabs), one at a328* time, through some mechanism provided by the object. The most common329* mechanism is a list of tabs at the top of the panel. The children of330* a page tab list are all page tabs.331* @see #PAGE_TAB332*/333public static final AccessibleRole PAGE_TAB_LIST334= new AccessibleRole("pagetablist");335336/**337* An object that is a child of a page tab list. Its sole child is338* the panel that is to be presented to the user when the user339* selects the page tab from the list of tabs in the page tab list.340* @see #PAGE_TAB_LIST341*/342public static final AccessibleRole PAGE_TAB343= new AccessibleRole("pagetab");344345/**346* A generic container that is often used to group objects.347*/348public static final AccessibleRole PANEL349= new AccessibleRole("panel");350351/**352* An object used to indicate how much of a task has been completed.353*/354public static final AccessibleRole PROGRESS_BAR355= new AccessibleRole("progressbar");356357/**358* A text object used for passwords, or other places where the359* text contents is not shown visibly to the user360*/361public static final AccessibleRole PASSWORD_TEXT362= new AccessibleRole("passwordtext");363364/**365* An object the user can manipulate to tell the application to do366* something.367* @see #CHECK_BOX368* @see #TOGGLE_BUTTON369* @see #RADIO_BUTTON370*/371public static final AccessibleRole PUSH_BUTTON372= new AccessibleRole("pushbutton");373374/**375* A specialized push button that can be checked or unchecked, but376* does not provide a separate indicator for the current state.377* @see #PUSH_BUTTON378* @see #CHECK_BOX379* @see #RADIO_BUTTON380*/381public static final AccessibleRole TOGGLE_BUTTON382= new AccessibleRole("togglebutton");383384/**385* A choice that can be checked or unchecked and provides a386* separate indicator for the current state.387* @see #PUSH_BUTTON388* @see #TOGGLE_BUTTON389* @see #RADIO_BUTTON390*/391public static final AccessibleRole CHECK_BOX392= new AccessibleRole("checkbox");393394/**395* A specialized check box that will cause other radio buttons in the396* same group to become unchecked when this one is checked.397* @see #PUSH_BUTTON398* @see #TOGGLE_BUTTON399* @see #CHECK_BOX400*/401public static final AccessibleRole RADIO_BUTTON402= new AccessibleRole("radiobutton");403404/**405* The header for a row of data.406*/407public static final AccessibleRole ROW_HEADER408= new AccessibleRole("rowheader");409410/**411* An object that allows a user to incrementally view a large amount412* of information. Its children can include scroll bars and a viewport.413* @see #SCROLL_BAR414* @see #VIEWPORT415*/416public static final AccessibleRole SCROLL_PANE417= new AccessibleRole("scrollpane");418419/**420* An object usually used to allow a user to incrementally view a421* large amount of data. Usually used only by a scroll pane.422* @see #SCROLL_PANE423*/424public static final AccessibleRole SCROLL_BAR425= new AccessibleRole("scrollbar");426427/**428* An object usually used in a scroll pane. It represents the portion429* of the entire data that the user can see. As the user manipulates430* the scroll bars, the contents of the viewport can change.431* @see #SCROLL_PANE432*/433public static final AccessibleRole VIEWPORT434= new AccessibleRole("viewport");435436/**437* An object that allows the user to select from a bounded range. For438* example, a slider might be used to select a number between 0 and 100.439*/440public static final AccessibleRole SLIDER441= new AccessibleRole("slider");442443/**444* A specialized panel that presents two other panels at the same time.445* Between the two panels is a divider the user can manipulate to make446* one panel larger and the other panel smaller.447*/448public static final AccessibleRole SPLIT_PANE449= new AccessibleRole("splitpane");450451/**452* An object used to present information in terms of rows and columns.453* An example might include a spreadsheet application.454*/455public static final AccessibleRole TABLE456= new AccessibleRole("table");457458/**459* An object that presents text to the user. The text is usually460* editable by the user as opposed to a label.461* @see #LABEL462*/463public static final AccessibleRole TEXT464= new AccessibleRole("text");465466/**467* An object used to present hierarchical information to the user.468* The individual nodes in the tree can be collapsed and expanded469* to provide selective disclosure of the tree's contents.470*/471public static final AccessibleRole TREE472= new AccessibleRole("tree");473474/**475* A bar or palette usually composed of push buttons or toggle buttons.476* It is often used to provide the most frequently used functions for an477* application.478*/479public static final AccessibleRole TOOL_BAR480= new AccessibleRole("toolbar");481482/**483* An object that provides information about another object. The484* accessibleDescription property of the tool tip is often displayed485* to the user in a small "help bubble" when the user causes the486* mouse to hover over the object associated with the tool tip.487*/488public static final AccessibleRole TOOL_TIP489= new AccessibleRole("tooltip");490491/**492* An AWT component, but nothing else is known about it.493* @see #SWING_COMPONENT494* @see #UNKNOWN495*/496public static final AccessibleRole AWT_COMPONENT497= new AccessibleRole("awtcomponent");498499/**500* A Swing component, but nothing else is known about it.501* @see #AWT_COMPONENT502* @see #UNKNOWN503*/504public static final AccessibleRole SWING_COMPONENT505= new AccessibleRole("swingcomponent");506507/**508* The object contains some Accessible information, but its role is509* not known.510* @see #AWT_COMPONENT511* @see #SWING_COMPONENT512*/513public static final AccessibleRole UNKNOWN514= new AccessibleRole("unknown");515516/**517* A STATUS_BAR is an simple component that can contain518* multiple labels of status information to the user.519*/520public static final AccessibleRole STATUS_BAR521= new AccessibleRole("statusbar");522523/**524* A DATE_EDITOR is a component that allows users to edit525* java.util.Date and java.util.Time objects526*/527public static final AccessibleRole DATE_EDITOR528= new AccessibleRole("dateeditor");529530/**531* A SPIN_BOX is a simple spinner component and its main use532* is for simple numbers.533*/534public static final AccessibleRole SPIN_BOX535= new AccessibleRole("spinbox");536537/**538* A FONT_CHOOSER is a component that lets the user pick various539* attributes for fonts.540*/541public static final AccessibleRole FONT_CHOOSER542= new AccessibleRole("fontchooser");543544/**545* A GROUP_BOX is a simple container that contains a border546* around it and contains components inside it.547*/548public static final AccessibleRole GROUP_BOX549= new AccessibleRole("groupbox");550551/**552* A text header553*554* @since 1.5555*/556public static final AccessibleRole HEADER =557new AccessibleRole("header");558559/**560* A text footer561*562* @since 1.5563*/564public static final AccessibleRole FOOTER =565new AccessibleRole("footer");566567/**568* A text paragraph569*570* @since 1.5571*/572public static final AccessibleRole PARAGRAPH =573new AccessibleRole("paragraph");574575/**576* A ruler is an object used to measure distance577*578* @since 1.5579*/580public static final AccessibleRole RULER =581new AccessibleRole("ruler");582583/**584* A role indicating the object acts as a formula for585* calculating a value. An example is a formula in586* a spreadsheet cell.587*588* @since 1.5589*/590static public final AccessibleRole EDITBAR =591new AccessibleRole("editbar");592593/**594* A role indicating the object monitors the progress595* of some operation.596*597* @since 1.5598*/599static public final AccessibleRole PROGRESS_MONITOR =600new AccessibleRole("progressMonitor");601602603// The following are all under consideration for potential future use.604605// public static final AccessibleRole APPLICATION606// = new AccessibleRole("application");607608// public static final AccessibleRole BORDER609// = new AccessibleRole("border");610611// public static final AccessibleRole CHECK_BOX_MENU_ITEM612// = new AccessibleRole("checkboxmenuitem");613614// public static final AccessibleRole CHOICE615// = new AccessibleRole("choice");616617// public static final AccessibleRole COLUMN618// = new AccessibleRole("column");619620// public static final AccessibleRole CURSOR621// = new AccessibleRole("cursor");622623// public static final AccessibleRole DOCUMENT624// = new AccessibleRole("document");625626// public static final AccessibleRole IMAGE627// = new AccessibleRole("Image");628629// public static final AccessibleRole INDICATOR630// = new AccessibleRole("indicator");631632// public static final AccessibleRole RADIO_BUTTON_MENU_ITEM633// = new AccessibleRole("radiobuttonmenuitem");634635// public static final AccessibleRole ROW636// = new AccessibleRole("row");637638// public static final AccessibleRole TABLE_CELL639// = new AccessibleRole("tablecell");640641// public static final AccessibleRole TREE_NODE642// = new AccessibleRole("treenode");643644/**645* Creates a new AccessibleRole using the given locale independent key.646* This should not be a public method. Instead, it is used to create647* the constants in this file to make it a strongly typed enumeration.648* Subclasses of this class should enforce similar policy.649* <p>650* The key String should be a locale independent key for the role.651* It is not intended to be used as the actual String to display652* to the user. To get the localized string, use toDisplayString.653*654* @param key the locale independent name of the role.655* @see AccessibleBundle#toDisplayString656*/657protected AccessibleRole(String key) {658this.key = key;659}660}661662663