diff -r 87c997b74bb8 -r 499d43823920 jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java --- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Thu Jun 08 22:07:08 2017 -0700 +++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,32 +25,30 @@ package javax.accessibility; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - *
Class AccessibleRole determines the role of a component. The role of a - * component describes its generic function. (E.G., -* "push button," "table," or "list.") - *
The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - *
The constants in this class present a strongly typed enumeration - * of common object roles. A public constructor for this class has been - * purposely omitted and applications should use one of the constants - * from this class. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleRole} determines the role of a component. The role of + * a component describes its generic function. (E.G., "push button," "table," or + * "list.") + *
+ * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + *
+ * The constants in this class present a strongly typed enumeration of common + * object roles. A public constructor for this class has been purposely omitted + * and applications should use one of the constants from this class. If the + * constants in this class are not sufficient to describe the role of an object, + * a subclass should be generated from this class and it should provide + * constants in a similar manner. * - * @author Willie Walker - * @author Peter Korn - * @author Lynn Monsanto + * @author Willie Walker + * @author Peter Korn + * @author Lynn Monsanto */ public class AccessibleRole extends AccessibleBundle { -// If you add or remove anything from here, make sure you -// update AccessibleResourceBundle.java. + // If you add or remove anything from here, make sure you + // update AccessibleResourceBundle.java. /** * Object is used to alert the user about something. @@ -65,8 +63,8 @@ = new AccessibleRole("columnheader"); /** - * Object that can be drawn into and is used to trap - * events. + * Object that can be drawn into and is used to trap events. + * * @see #FRAME * @see #GLASS_PANE * @see #LAYERED_PANE @@ -75,14 +73,15 @@ = new AccessibleRole("canvas"); /** - * A list of choices the user can select from. Also optionally - * allows the user to enter a choice of their own. + * A list of choices the user can select from. Also optionally allows the + * user to enter a choice of their own. */ public static final AccessibleRole COMBO_BOX = new AccessibleRole("combobox"); /** - * An iconified internal frame in a DESKTOP_PANE. + * An iconified internal frame in a {@code DESKTOP_PANE}. + * * @see #DESKTOP_PANE * @see #INTERNAL_FRAME */ @@ -90,11 +89,12 @@ = new AccessibleRole("desktopicon"); /** - * An object containing a collection of {@code Accessibles} that - * together represents {@code HTML} content. The child - * {@code Accessibles} would include objects implementing - * {@code AccessibleText}, {@code AccessibleHypertext}, - * {@code AccessibleIcon}, and other interfaces. + * An object containing a collection of {@code Accessibles} that together + * represents {@code HTML} content. The child {@code Accessibles} would + * include objects implementing {@code AccessibleText}, + * {@code AccessibleHypertext}, {@code AccessibleIcon}, and other + * interfaces. + * * @see #HYPERLINK * @see AccessibleText * @see AccessibleHypertext @@ -106,10 +106,10 @@ = new AccessibleRole("htmlcontainer"); /** - * A frame-like object that is clipped by a desktop pane. The - * desktop pane, internal frame, and desktop icon objects are - * often used to create multiple document interfaces within an - * application. + * A frame-like object that is clipped by a desktop pane. The desktop pane, + * internal frame, and desktop icon objects are often used to create + * multiple document interfaces within an application. + * * @see #DESKTOP_ICON * @see #DESKTOP_PANE * @see #FRAME @@ -118,8 +118,9 @@ = new AccessibleRole("internalframe"); /** - * A pane that supports internal frames and - * iconified versions of those internal frames. + * A pane that supports internal frames and iconified versions of those + * internal frames. + * * @see #DESKTOP_ICON * @see #INTERNAL_FRAME */ @@ -127,7 +128,8 @@ = new AccessibleRole("desktoppane"); /** - * A specialized pane whose primary use is inside a DIALOG + * A specialized pane whose primary use is inside a {@code DIALOG}. + * * @see #DIALOG */ public static final AccessibleRole OPTION_PANE @@ -135,6 +137,7 @@ /** * A top level window with no title or border. + * * @see #FRAME * @see #DIALOG */ @@ -142,8 +145,9 @@ = new AccessibleRole("window"); /** - * A top level window with a title bar, border, menu bar, etc. It is - * often used as the primary window for an application. + * A top level window with a title bar, border, menu bar, etc. It is often + * used as the primary window for an application. + * * @see #DIALOG * @see #CANVAS * @see #WINDOW @@ -152,9 +156,10 @@ = new AccessibleRole("frame"); /** - * A top level window with title bar and a border. A dialog is similar - * to a frame, but it has fewer properties and is often used as a - * secondary window for an application. + * A top level window with title bar and a border. A dialog is similar to a + * frame, but it has fewer properties and is often used as a secondary + * window for an application. + * * @see #FRAME * @see #WINDOW */ @@ -169,34 +174,34 @@ /** - * A pane that allows the user to navigate through - * and select the contents of a directory. May be used - * by a file chooser. + * A pane that allows the user to navigate through and select the contents + * of a directory. May be used by a file chooser. + * * @see #FILE_CHOOSER */ public static final AccessibleRole DIRECTORY_PANE = new AccessibleRole("directorypane"); /** - * A specialized dialog that displays the files in the directory - * and lets the user select a file, browse a different directory, - * or specify a filename. May use the directory pane to show the - * contents of a directory. + * A specialized dialog that displays the files in the directory and lets + * the user select a file, browse a different directory, or specify a + * filename. May use the directory pane to show the contents of a directory. + * * @see #DIRECTORY_PANE */ public static final AccessibleRole FILE_CHOOSER = new AccessibleRole("filechooser"); /** - * An object that fills up space in a user interface. It is often - * used in interfaces to tweak the spacing between components, - * but serves no other purpose. + * An object that fills up space in a user interface. It is often used in + * interfaces to tweak the spacing between components, but serves no other + * purpose. */ public static final AccessibleRole FILLER = new AccessibleRole("filler"); /** - * A hypertext anchor + * A hypertext anchor. */ public static final AccessibleRole HYPERLINK = new AccessibleRole("hyperlink"); @@ -216,6 +221,7 @@ /** * A specialized pane that has a glass pane and a layered pane as its * children. + * * @see #GLASS_PANE * @see #LAYERED_PANE */ @@ -223,8 +229,8 @@ = new AccessibleRole("rootpane"); /** - * A pane that is guaranteed to be painted on top - * of all panes beneath it. + * A pane that is guaranteed to be painted on top of all panes beneath it. + * * @see #ROOT_PANE * @see #CANVAS */ @@ -233,9 +239,10 @@ /** * A specialized pane that allows its children to be drawn in layers, - * providing a form of stacking order. This is usually the pane that - * holds the menu bar as well as the pane that contains most of the - * visual components in a window. + * providing a form of stacking order. This is usually the pane that holds + * the menu bar as well as the pane that contains most of the visual + * components in a window. + * * @see #GLASS_PANE * @see #ROOT_PANE */ @@ -243,9 +250,10 @@ = new AccessibleRole("layeredpane"); /** - * An object that presents a list of objects to the user and allows the - * user to select one or more of them. A list is usually contained - * within a scroll pane. + * An object that presents a list of objects to the user and allows the user + * to select one or more of them. A list is usually contained within a + * scroll pane. + * * @see #SCROLL_PANE * @see #LIST_ITEM */ @@ -253,8 +261,9 @@ = new AccessibleRole("list"); /** - * An object that presents an element in a list. A list is usually - * contained within a scroll pane. + * An object that presents an element in a list. A list is usually contained + * within a scroll pane. + * * @see #SCROLL_PANE * @see #LIST */ @@ -262,10 +271,10 @@ = new AccessibleRole("listitem"); /** - * An object usually drawn at the top of the primary dialog box of - * an application that contains a list of menus the user can choose - * from. For example, a menu bar might contain menus for "File," - * "Edit," and "Help." + * An object usually drawn at the top of the primary dialog box of an + * application that contains a list of menus the user can choose from. For + * example, a menu bar might contain menus for "File," "Edit," and "Help." + * * @see #MENU * @see #POPUP_MENU * @see #LAYERED_PANE @@ -274,9 +283,9 @@ = new AccessibleRole("menubar"); /** - * A temporary window that is usually used to offer the user a - * list of choices, and then hides when the user selects one of - * those choices. + * A temporary window that is usually used to offer the user a list of + * choices, and then hides when the user selects one of those choices. + * * @see #MENU * @see #MENU_ITEM */ @@ -284,12 +293,12 @@ = new AccessibleRole("popupmenu"); /** - * An object usually found inside a menu bar that contains a list - * of actions the user can choose from. A menu can have any object - * as its children, but most often they are menu items, other menus, - * or rudimentary objects such as radio buttons, check boxes, or - * separators. For example, an application may have an "Edit" menu - * that contains menu items for "Cut" and "Paste." + * An object usually found inside a menu bar that contains a list of actions + * the user can choose from. A menu can have any object as its children, but + * most often they are menu items, other menus, or rudimentary objects such + * as radio buttons, check boxes, or separators. For example, an application + * may have an "Edit" menu that contains menu items for "Cut" and "Paste." + * * @see #MENU_BAR * @see #MENU_ITEM * @see #SEPARATOR @@ -301,10 +310,11 @@ = new AccessibleRole("menu"); /** - * An object usually contained in a menu that presents an action - * the user can choose. For example, the "Cut" menu item in an - * "Edit" menu would be an action the user can select to cut the - * selected area of text in a document. + * An object usually contained in a menu that presents an action the user + * can choose. For example, the "Cut" menu item in an "Edit" menu would be + * an action the user can select to cut the selected area of text in a + * document. + * * @see #MENU_BAR * @see #SEPARATOR * @see #POPUP_MENU @@ -313,11 +323,11 @@ = new AccessibleRole("menuitem"); /** - * An object usually contained in a menu to provide a visual - * and logical separation of the contents in a menu. For example, - * the "File" menu of an application might contain menu items for - * "Open," "Close," and "Exit," and will place a separator between - * "Close" and "Exit" menu items. + * An object usually contained in a menu to provide a visual and logical + * separation of the contents in a menu. For example, the "File" menu of an + * application might contain menu items for "Open," "Close," and "Exit," and + * will place a separator between "Close" and "Exit" menu items. + * * @see #MENU * @see #MENU_ITEM */ @@ -325,19 +335,21 @@ = new AccessibleRole("separator"); /** - * An object that presents a series of panels (or page tabs), one at a - * time, through some mechanism provided by the object. The most common - * mechanism is a list of tabs at the top of the panel. The children of - * a page tab list are all page tabs. + * An object that presents a series of panels (or page tabs), one at a time, + * through some mechanism provided by the object. The most common mechanism + * is a list of tabs at the top of the panel. The children of a page tab + * list are all page tabs. + * * @see #PAGE_TAB */ public static final AccessibleRole PAGE_TAB_LIST = new AccessibleRole("pagetablist"); /** - * An object that is a child of a page tab list. Its sole child is - * the panel that is to be presented to the user when the user - * selects the page tab from the list of tabs in the page tab list. + * An object that is a child of a page tab list. Its sole child is the panel + * that is to be presented to the user when the user selects the page tab + * from the list of tabs in the page tab list. + * * @see #PAGE_TAB_LIST */ public static final AccessibleRole PAGE_TAB @@ -356,8 +368,8 @@ = new AccessibleRole("progressbar"); /** - * A text object used for passwords, or other places where the - * text contents is not shown visibly to the user + * A text object used for passwords, or other places where the text contents + * is not shown visibly to the user. */ public static final AccessibleRole PASSWORD_TEXT = new AccessibleRole("passwordtext"); @@ -365,6 +377,7 @@ /** * An object the user can manipulate to tell the application to do * something. + * * @see #CHECK_BOX * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -373,8 +386,9 @@ = new AccessibleRole("pushbutton"); /** - * A specialized push button that can be checked or unchecked, but - * does not provide a separate indicator for the current state. + * A specialized push button that can be checked or unchecked, but does not + * provide a separate indicator for the current state. + * * @see #PUSH_BUTTON * @see #CHECK_BOX * @see #RADIO_BUTTON @@ -383,8 +397,9 @@ = new AccessibleRole("togglebutton"); /** - * A choice that can be checked or unchecked and provides a - * separate indicator for the current state. + * A choice that can be checked or unchecked and provides a separate + * indicator for the current state. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -393,8 +408,9 @@ = new AccessibleRole("checkbox"); /** - * A specialized check box that will cause other radio buttons in the - * same group to become unchecked when this one is checked. + * A specialized check box that will cause other radio buttons in the same + * group to become unchecked when this one is checked. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #CHECK_BOX @@ -409,8 +425,9 @@ = new AccessibleRole("rowheader"); /** - * An object that allows a user to incrementally view a large amount - * of information. Its children can include scroll bars and a viewport. + * An object that allows a user to incrementally view a large amount of + * information. Its children can include scroll bars and a viewport. + * * @see #SCROLL_BAR * @see #VIEWPORT */ @@ -418,24 +435,26 @@ = new AccessibleRole("scrollpane"); /** - * An object usually used to allow a user to incrementally view a - * large amount of data. Usually used only by a scroll pane. + * An object usually used to allow a user to incrementally view a large + * amount of data. Usually used only by a scroll pane. + * * @see #SCROLL_PANE */ public static final AccessibleRole SCROLL_BAR = new AccessibleRole("scrollbar"); /** - * An object usually used in a scroll pane. It represents the portion - * of the entire data that the user can see. As the user manipulates - * the scroll bars, the contents of the viewport can change. + * An object usually used in a scroll pane. It represents the portion of the + * entire data that the user can see. As the user manipulates the scroll + * bars, the contents of the viewport can change. + * * @see #SCROLL_PANE */ public static final AccessibleRole VIEWPORT = new AccessibleRole("viewport"); /** - * An object that allows the user to select from a bounded range. For + * An object that allows the user to select from a bounded range. For * example, a slider might be used to select a number between 0 and 100. */ public static final AccessibleRole SLIDER @@ -443,54 +462,56 @@ /** * A specialized panel that presents two other panels at the same time. - * Between the two panels is a divider the user can manipulate to make - * one panel larger and the other panel smaller. + * Between the two panels is a divider the user can manipulate to make one + * panel larger and the other panel smaller. */ public static final AccessibleRole SPLIT_PANE = new AccessibleRole("splitpane"); /** - * An object used to present information in terms of rows and columns. - * An example might include a spreadsheet application. + * An object used to present information in terms of rows and columns. An + * example might include a spreadsheet application. */ public static final AccessibleRole TABLE = new AccessibleRole("table"); /** - * An object that presents text to the user. The text is usually - * editable by the user as opposed to a label. + * An object that presents text to the user. The text is usually editable by + * the user as opposed to a label. + * * @see #LABEL */ public static final AccessibleRole TEXT = new AccessibleRole("text"); /** - * An object used to present hierarchical information to the user. - * The individual nodes in the tree can be collapsed and expanded - * to provide selective disclosure of the tree's contents. + * An object used to present hierarchical information to the user. The + * individual nodes in the tree can be collapsed and expanded to provide + * selective disclosure of the tree's contents. */ public static final AccessibleRole TREE = new AccessibleRole("tree"); /** - * A bar or palette usually composed of push buttons or toggle buttons. - * It is often used to provide the most frequently used functions for an + * A bar or palette usually composed of push buttons or toggle buttons. It + * is often used to provide the most frequently used functions for an * application. */ public static final AccessibleRole TOOL_BAR = new AccessibleRole("toolbar"); /** - * An object that provides information about another object. The - * accessibleDescription property of the tool tip is often displayed - * to the user in a small "help bubble" when the user causes the - * mouse to hover over the object associated with the tool tip. + * An object that provides information about another object. The + * {@code accessibleDescription} property of the tool tip is often displayed + * to the user in a small "help bubble" when the user causes the mouse to + * hover over the object associated with the tool tip. */ public static final AccessibleRole TOOL_TIP = new AccessibleRole("tooltip"); /** * An AWT component, but nothing else is known about it. + * * @see #SWING_COMPONENT * @see #UNKNOWN */ @@ -499,6 +520,7 @@ /** * A Swing component, but nothing else is known about it. + * * @see #AWT_COMPONENT * @see #UNKNOWN */ @@ -506,8 +528,9 @@ = new AccessibleRole("swingcomponent"); /** - * The object contains some Accessible information, but its role is + * The object contains some {@code Accessible} information, but its role is * not known. + * * @see #AWT_COMPONENT * @see #SWING_COMPONENT */ @@ -515,42 +538,42 @@ = new AccessibleRole("unknown"); /** - * A STATUS_BAR is an simple component that can contain - * multiple labels of status information to the user. + * A {@code STATUS_BAR} is an simple component that can contain multiple + * labels of status information to the user. */ public static final AccessibleRole STATUS_BAR = new AccessibleRole("statusbar"); /** - * A DATE_EDITOR is a component that allows users to edit - * java.util.Date and java.util.Time objects + * A {@code DATE_EDITOR} is a component that allows users to edit + * {@code java.util.Date} and {@code java.util.Time} objects. */ public static final AccessibleRole DATE_EDITOR = new AccessibleRole("dateeditor"); /** - * A SPIN_BOX is a simple spinner component and its main use - * is for simple numbers. + * A {@code SPIN_BOX} is a simple spinner component and its main use is for + * simple numbers. */ public static final AccessibleRole SPIN_BOX = new AccessibleRole("spinbox"); /** - * A FONT_CHOOSER is a component that lets the user pick various + * A {@code FONT_CHOOSER} is a component that lets the user pick various * attributes for fonts. */ public static final AccessibleRole FONT_CHOOSER = new AccessibleRole("fontchooser"); /** - * A GROUP_BOX is a simple container that contains a border - * around it and contains components inside it. + * A {@code GROUP_BOX} is a simple container that contains a border around + * it and contains components inside it. */ public static final AccessibleRole GROUP_BOX = new AccessibleRole("groupbox"); /** - * A text header + * A text header. * * @since 1.5 */ @@ -558,7 +581,7 @@ new AccessibleRole("header"); /** - * A text footer + * A text footer. * * @since 1.5 */ @@ -566,7 +589,7 @@ new AccessibleRole("footer"); /** - * A text paragraph + * A text paragraph. * * @since 1.5 */ @@ -574,7 +597,7 @@ new AccessibleRole("paragraph"); /** - * A ruler is an object used to measure distance + * A ruler is an object used to measure distance. * * @since 1.5 */ @@ -582,9 +605,8 @@ new AccessibleRole("ruler"); /** - * A role indicating the object acts as a formula for - * calculating a value. An example is a formula in - * a spreadsheet cell. + * A role indicating the object acts as a formula for calculating a value. + * An example is a formula in a spreadsheet cell. * * @since 1.5 */ @@ -592,8 +614,7 @@ new AccessibleRole("editbar"); /** - * A role indicating the object monitors the progress - * of some operation. + * A role indicating the object monitors the progress of some operation. * * @since 1.5 */ @@ -643,16 +664,16 @@ // = new AccessibleRole("treenode"); /** - * Creates a new AccessibleRole using the given locale independent key. - * This should not be a public method. Instead, it is used to create + * Creates a new {@code AccessibleRole} using the given locale independent + * key. This should not be a public method. Instead, it is used to create * the constants in this file to make it a strongly typed enumeration. * Subclasses of this class should enforce similar policy. *
- * The key String should be a locale independent key for the role. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * The key {@code String} should be a locale independent key for the role. + * It is not intended to be used as the actual {@code String} to display to + * the user. To get the localized string, use {@link #toDisplayString()}. * - * @param key the locale independent name of the role. + * @param key the locale independent name of the role * @see AccessibleBundle#toDisplayString */ protected AccessibleRole(String key) {