AccessibleRole.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. /* AccessibleRole.java -- the primary role of an accessible object
  2. Copyright (C) 2002, 2005 Free Software Foundation
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package javax.accessibility;
  32. import java.util.Locale;
  33. /**
  34. * The role of an accessible object. For example, this could be "button" or
  35. * "table". This strongly typed "enumeration" supports localized strings. If
  36. * the constants of this class are not adequate, new ones may be added in a
  37. * similar matter, while avoiding a public constructor.
  38. *
  39. * @author Eric Blake (ebb9@email.byu.edu)
  40. * @since 1.2
  41. * @status updated to 1.4
  42. */
  43. public class AccessibleRole extends AccessibleBundle
  44. {
  45. /** The object alerts the user about something. */
  46. public static final AccessibleRole ALERT
  47. = new AccessibleRole("alert");
  48. /** The header for a column of data. */
  49. public static final AccessibleRole COLUMN_HEADER
  50. = new AccessibleRole("column header");
  51. /**
  52. * The object can be drawn into, and traps events.
  53. *
  54. * @see #FRAME
  55. * @see #GLASS_PANE
  56. * @see #LAYERED_PANE
  57. */
  58. public static final AccessibleRole CANVAS
  59. = new AccessibleRole("canvas");
  60. /**
  61. * A list of choices, which may optionally allow the user to create a new
  62. * choice.
  63. */
  64. public static final AccessibleRole COMBO_BOX
  65. = new AccessibleRole("combo box");
  66. /**
  67. * An iconified frame in a desktop.
  68. *
  69. * @see #DESKTOP_PANE
  70. * @see #INTERNAL_FRAME
  71. */
  72. public static final AccessibleRole DESKTOP_ICON
  73. = new AccessibleRole("desktop icon");
  74. /**
  75. * A frame-like object clipped by a desktop pane.
  76. *
  77. * @see #DESKTOP_ICON
  78. * @see #DESKTOP_PANE
  79. * @see #FRAME
  80. */
  81. public static final AccessibleRole INTERNAL_FRAME
  82. = new AccessibleRole("internal frame");
  83. /**
  84. * A pane which supports internal frames and their icons.
  85. *
  86. * @see #DESKTOP_ICON
  87. * @see #INTERNAL_FRAME
  88. */
  89. public static final AccessibleRole DESKTOP_PANE
  90. = new AccessibleRole("desktop pane");
  91. /**
  92. * A specialized pane for use in a dialog.
  93. *
  94. * @see #DIALOG
  95. */
  96. public static final AccessibleRole OPTION_PANE
  97. = new AccessibleRole("option pane");
  98. /**
  99. * A top level window with no title or border.
  100. *
  101. * @see #FRAME
  102. * @see #DIALOG
  103. */
  104. public static final AccessibleRole WINDOW
  105. = new AccessibleRole("window");
  106. /**
  107. * A top level window with title, menu bar, border, and so forth. It is
  108. * often the primary window of an application.
  109. *
  110. * @see #DIALOG
  111. * @see #CANVAS
  112. * @see #WINDOW
  113. */
  114. public static final AccessibleRole FRAME
  115. = new AccessibleRole("frame");
  116. /**
  117. * A top level window title bar and border. It is limited compared to a
  118. * frame, and is often a secondary window.
  119. *
  120. * @see #FRAME
  121. * @see #WINDOW
  122. */
  123. public static final AccessibleRole DIALOG
  124. = new AccessibleRole("dialog");
  125. /** A specialized dialog for choosing a color. */
  126. public static final AccessibleRole COLOR_CHOOSER
  127. = new AccessibleRole("color chooser");
  128. /**
  129. * A pane for navigating through directories.
  130. *
  131. * @see #FILE_CHOOSER
  132. */
  133. public static final AccessibleRole DIRECTORY_PANE
  134. = new AccessibleRole("directory pane");
  135. /**
  136. * A specialized dialog that allows a user to select a file.
  137. *
  138. * @see #DIRECTORY_PANE
  139. */
  140. public static final AccessibleRole FILE_CHOOSER
  141. = new AccessibleRole("file chooser");
  142. /** An object to fill space between other components. */
  143. public static final AccessibleRole FILLER
  144. = new AccessibleRole("filler");
  145. /** A hypertext anchor. */
  146. public static final AccessibleRole HYPERLINK
  147. = new AccessibleRole("hyperlink");
  148. /** A small picture to decorate components. */
  149. public static final AccessibleRole ICON
  150. = new AccessibleRole("icon");
  151. /** An object to label something in a graphic interface. */
  152. public static final AccessibleRole LABEL
  153. = new AccessibleRole("label");
  154. /**
  155. * A specialized pane with a glass pane and layered pane as children.
  156. *
  157. * @see #GLASS_PANE
  158. * @see #LAYERED_PANE
  159. */
  160. public static final AccessibleRole ROOT_PANE
  161. = new AccessibleRole("root pane");
  162. /**
  163. * A pane guaranteed to be painted on top of panes beneath it.
  164. *
  165. * @see #ROOT_PANE
  166. * @see #LAYERED_PANE
  167. */
  168. public static final AccessibleRole GLASS_PANE
  169. = new AccessibleRole("glass pane");
  170. /**
  171. * A specialized pane that allows drawing children in layers. This is often
  172. * used in menus and other visual components.
  173. *
  174. * @see #ROOT_PANE
  175. * @see #GLASS_PANE
  176. */
  177. public static final AccessibleRole LAYERED_PANE
  178. = new AccessibleRole("layered pane");
  179. /**
  180. * An object which presents a list of items for selection. Often contained
  181. * in a scroll pane.
  182. *
  183. * @see #SCROLL_PANE
  184. * @see #LIST_ITEM
  185. */
  186. public static final AccessibleRole LIST
  187. = new AccessibleRole("list");
  188. /**
  189. * An object which represents an item in a list. Often contained in a scroll
  190. * pane.
  191. *
  192. * @see #SCROLL_PANE
  193. * @see #LIST
  194. */
  195. public static final AccessibleRole LIST_ITEM
  196. = new AccessibleRole("list item");
  197. /**
  198. * An object usually at the top of a frame to list available menus.
  199. *
  200. * @see #MENU
  201. * @see #POPUP_MENU
  202. * @see #LAYERED_PANE
  203. */
  204. public static final AccessibleRole MENU_BAR
  205. = new AccessibleRole("menu bar");
  206. /**
  207. * A temporary window with a menu of options, which hides on selection.
  208. *
  209. * @see #MENU
  210. * @see #MENU_ITEM
  211. */
  212. public static final AccessibleRole POPUP_MENU
  213. = new AccessibleRole("popup menu");
  214. /**
  215. * An object usually in a menu bar which contains a list of actions to
  216. * perform. Such actions are usually associated with menu items or submenus.
  217. *
  218. * @see #MENU_BAR
  219. * @see #MENU_ITEM
  220. * @see #SEPARATOR
  221. * @see #RADIO_BUTTON
  222. * @see #CHECK_BOX
  223. * @see #POPUP_MENU
  224. */
  225. public static final AccessibleRole MENU
  226. = new AccessibleRole("menu");
  227. /**
  228. * An object usually in a menu with an action available for the user.
  229. *
  230. * @see #MENU_BAR
  231. * @see #SEPARATOR
  232. * @see #POPUP_MENU
  233. */
  234. public static final AccessibleRole MENU_ITEM
  235. = new AccessibleRole("menu item");
  236. /**
  237. * An object usually in a menu which separates logical sections of items.
  238. *
  239. * @see #MENU
  240. * @see #MENU_ITEM
  241. */
  242. public static final AccessibleRole SEPARATOR
  243. = new AccessibleRole("separator");
  244. /**
  245. * An object which presents a series of panels, usually via tabs along the
  246. * top. Children are all page tabs.
  247. *
  248. * @see #PAGE_TAB
  249. */
  250. public static final AccessibleRole PAGE_TAB_LIST
  251. = new AccessibleRole("page tab list");
  252. /**
  253. * An object in a page tab list, which contains the panel to display when
  254. * selected from the list.
  255. *
  256. * @see #PAGE_TAB_LIST
  257. */
  258. public static final AccessibleRole PAGE_TAB
  259. = new AccessibleRole("page tab");
  260. /** A generic container to group objects. */
  261. public static final AccessibleRole PANEL
  262. = new AccessibleRole("panel");
  263. /** An object used to track amount of a task that has completed. */
  264. public static final AccessibleRole PROGRESS_BAR
  265. = new AccessibleRole("progress bar");
  266. /** An object for passwords which should not be shown to the user. */
  267. public static final AccessibleRole PASSWORD_TEXT
  268. = new AccessibleRole("password text");
  269. /**
  270. * An object that can be manipulated to do something.
  271. *
  272. * @see #CHECK_BOX
  273. * @see #TOGGLE_BUTTON
  274. * @see #RADIO_BUTTON
  275. */
  276. public static final AccessibleRole PUSH_BUTTON
  277. = new AccessibleRole("push button");
  278. /**
  279. * A specialized button which can be on or off, with no separate indicator.
  280. *
  281. * @see #PUSH_BUTTON
  282. * @see #CHECK_BOX
  283. * @see #RADIO_BUTTON
  284. */
  285. public static final AccessibleRole TOGGLE_BUTTON
  286. = new AccessibleRole("toggle button");
  287. /**
  288. * A choice which can be on or off, and has a separate indicator.
  289. *
  290. * @see #PUSH_BUTTON
  291. * @see #TOGGLE_BUTTON
  292. * @see #RADIO_BUTTON
  293. */
  294. public static final AccessibleRole CHECK_BOX
  295. = new AccessibleRole("check box");
  296. /**
  297. * A specialized choice which toggles radio buttons in the group when it
  298. * is selected.
  299. *
  300. * @see #PUSH_BUTTON
  301. * @see #TOGGLE_BUTTON
  302. * @see #CHECK_BOX
  303. */
  304. public static final AccessibleRole RADIO_BUTTON
  305. = new AccessibleRole("radio button");
  306. /** The header for a row of data. */
  307. public static final AccessibleRole ROW_HEADER
  308. = new AccessibleRole("row header");
  309. /**
  310. * An object which allows an incremental view of a larger pane.
  311. *
  312. * @see #SCROLL_BAR
  313. * @see #VIEWPORT
  314. */
  315. public static final AccessibleRole SCROLL_PANE
  316. = new AccessibleRole("scroll pane");
  317. /**
  318. * An object which allows selection of the view in a scroll pane.
  319. *
  320. * @see #SCROLL_PANE
  321. */
  322. public static final AccessibleRole SCROLL_BAR
  323. = new AccessibleRole("scroll bar");
  324. /**
  325. * An object which represents the visual section in a scroll pane.
  326. *
  327. * @see #SCROLL_PANE
  328. */
  329. public static final AccessibleRole VIEWPORT
  330. = new AccessibleRole("viewport");
  331. /** An object which allows selection in a bounded range. */
  332. public static final AccessibleRole SLIDER
  333. = new AccessibleRole("slider");
  334. /**
  335. * A specialized pane which presents two other panels, and can often adjust
  336. * the divider between them.
  337. */
  338. public static final AccessibleRole SPLIT_PANE
  339. = new AccessibleRole("split pane");
  340. /** An object for presenting data in rows and columns. */
  341. public static final AccessibleRole TABLE
  342. = new AccessibleRole("table");
  343. /**
  344. * An object which represents text, usually editable by the user.
  345. *
  346. * @see #LABEL
  347. */
  348. public static final AccessibleRole TEXT
  349. = new AccessibleRole("text");
  350. /**
  351. * An object which represents a hierachical view of data. Subnodes can
  352. * often be expanded or collapsed.
  353. */
  354. public static final AccessibleRole TREE
  355. = new AccessibleRole("tree");
  356. /** A bar or pallete with buttons for common actions in an application. */
  357. public static final AccessibleRole TOOL_BAR
  358. = new AccessibleRole("tool bar");
  359. /**
  360. * An object which provides information about another object. This is often
  361. * displayed as a "help bubble" when a mouse hovers over the other object.
  362. */
  363. public static final AccessibleRole TOOL_TIP
  364. = new AccessibleRole("tool tip");
  365. /**
  366. * An AWT component with nothing else known about it.
  367. *
  368. * @see #SWING_COMPONENT
  369. * @see #UNKNOWN
  370. */
  371. public static final AccessibleRole AWT_COMPONENT
  372. = new AccessibleRole("AWT component");
  373. /**
  374. * A swing component with nothing else known about it.
  375. *
  376. * @see #AWT_COMPONENT
  377. * @see #UNKNOWN
  378. */
  379. public static final AccessibleRole SWING_COMPONENT
  380. = new AccessibleRole("SWING component");
  381. /**
  382. * An accessible object whose role is unknown.
  383. *
  384. * @see #AWT_COMPONENT
  385. * @see #SWING_COMPONENT
  386. */
  387. public static final AccessibleRole UNKNOWN
  388. = new AccessibleRole("unknown");
  389. /** A component with multiple labels of status information. */
  390. public static final AccessibleRole STATUS_BAR
  391. = new AccessibleRole("statusbar");
  392. /** A component which allows editing of Date and Time objects. */
  393. public static final AccessibleRole DATE_EDITOR
  394. = new AccessibleRole("dateeditor");
  395. /** A component with spinner arrows for simple numbers. */
  396. public static final AccessibleRole SPIN_BOX
  397. = new AccessibleRole("spinbox");
  398. /** A component for choosing fonts and their attributes. */
  399. public static final AccessibleRole FONT_CHOOSER
  400. = new AccessibleRole("fontchooser");
  401. /** A component with a border to group other components. */
  402. public static final AccessibleRole GROUP_BOX
  403. = new AccessibleRole("groupbox");
  404. /**
  405. * A formula for creating a value.
  406. *
  407. * @since 1.5
  408. */
  409. public static final AccessibleRole EDITBAR
  410. = new AccessibleRole("editbar");
  411. /**
  412. * A text-based footer.
  413. *
  414. * @since 1.5
  415. */
  416. public static final AccessibleRole FOOTER
  417. = new AccessibleRole("footer");
  418. /**
  419. * A text-based header.
  420. *
  421. * @since 1.5
  422. */
  423. public static final AccessibleRole HEADER
  424. = new AccessibleRole("header");
  425. /**
  426. * A text-based paragraph.
  427. *
  428. * @since 1.5
  429. */
  430. public static final AccessibleRole PARAGRAPH
  431. = new AccessibleRole("paragraph");
  432. /**
  433. * Represents the current level of progress on a particular task.
  434. *
  435. * @since 1.5
  436. */
  437. public static final AccessibleRole PROGRESS_MONITOR
  438. = new AccessibleRole("progress monitor");
  439. /**
  440. * A ruler is a method of measuring the distance between two
  441. * points.
  442. *
  443. * @since 1.5
  444. */
  445. public static final AccessibleRole RULER
  446. = new AccessibleRole("ruler");
  447. /**
  448. * A HTML container is an accessible object which contains other
  449. * accessible objects that together form some HTML content. For example,
  450. * the content may be a sequence of text containing a link, which
  451. * would be represent as two children, one an {@link AccessibleText}
  452. * object holding the normal text and the other an
  453. * {@link AccessibleHypertext} object representing the link.
  454. *
  455. * @since 1.6
  456. */
  457. public static final AccessibleRole HTML_CONTAINER
  458. = new AccessibleRole("HTML container");
  459. /**
  460. * Create a new constant with a locale independent key. Follow the example,
  461. * keep the constructor private and make public constants instead.
  462. *
  463. * @param key the name of the role
  464. * @see #toDisplayString(String, Locale)
  465. */
  466. protected AccessibleRole(String key)
  467. {
  468. this.key = key;
  469. }
  470. } // class AccessibleRole