Imported GNU Classpath 0.90
[official-gcc.git] / libjava / classpath / javax / accessibility / AccessibleState.java
blobe4d00bd70b88000f7b09b2b14087e9e49df4bd39
1 /* AccessibleState.java -- a state of an accessible object
2 Copyright (C) 2002, 2005 Free Software Foundation
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package javax.accessibility;
40 import java.awt.Dimension;
41 import java.util.Locale;
43 /**
44 * A state portion of an accessible object. A combination of states represent
45 * the entire object state, in an AccessibleStateSet. For example, this could
46 * be "active" or "selected". This strongly typed "enumeration" supports
47 * localized strings. If the constants of this class are not adequate, new
48 * ones may be added in a similar matter, while avoiding a public constructor.
50 * @author Eric Blake (ebb9@email.byu.edu)
51 * @since 1.2
52 * @status updated to 1.4
54 public class AccessibleState extends AccessibleBundle
56 /**
57 * Indicates an active window, as well as an active child in a list or other
58 * collection.
60 * @see AccessibleRole#WINDOW
61 * @see AccessibleRole#FRAME
62 * @see AccessibleRole#DIALOG
64 public static final AccessibleState ACTIVE
65 = new AccessibleState("active");
67 /**
68 * Indicates a pushed button, usually when the mouse has been pressed but
69 * not released.
71 * @see AccessibleRole#PUSH_BUTTON
73 public static final AccessibleState PRESSED
74 = new AccessibleState("pressed");
76 /**
77 * Indicates an armed object, usually a button which has been pushed and
78 * the mouse has not left the button area.
80 * @see AccessibleRole#PUSH_BUTTON
82 public static final AccessibleState ARMED
83 = new AccessibleState("armed");
85 /**
86 * Indicates an object is busy, such as a slider, scroll bar, or progress
87 * bar in transition.
89 * @see AccessibleRole#PROGRESS_BAR
90 * @see AccessibleRole#SCROLL_BAR
91 * @see AccessibleRole#SLIDER
93 public static final AccessibleState BUSY
94 = new AccessibleState("busy");
96 /**
97 * Indicates an object is checked.
99 * @see AccessibleRole#TOGGLE_BUTTON
100 * @see AccessibleRole#RADIO_BUTTON
101 * @see AccessibleRole#CHECK_BOX
103 public static final AccessibleState CHECKED
104 = new AccessibleState("checked");
107 * Indicates the user can edit the component contents. This is usually for
108 * text, as other objects like scroll bars are automatically editable.
110 * @see #ENABLED
112 public static final AccessibleState EDITABLE
113 = new AccessibleState("editable");
116 * Indicates the object allows progressive disclosure of its children,
117 * usually in a collapsible tree or other hierachical object.
119 * @see #EXPANDED
120 * @see #COLLAPSED
121 * @see AccessibleRole#TREE
123 public static final AccessibleState EXPANDABLE
124 = new AccessibleState("expandable");
127 * Indicates that the object is collapsed, usually in a tree.
129 * @see #EXPANDABLE
130 * @see #EXPANDED
131 * @see AccessibleRole#TREE
133 public static final AccessibleState COLLAPSED
134 = new AccessibleState("collapsed");
137 * Indicates that the object is expanded, usually in a tree.
139 * @see #EXPANDABLE
140 * @see #COLLAPSED
141 * @see AccessibleRole#TREE
143 public static final AccessibleState EXPANDED
144 = new AccessibleState("expanded");
147 * Indicates that an object is enabled. In the absence of this state,
148 * graphics are often grayed out, and cannot be manipulated.
150 public static final AccessibleState ENABLED
151 = new AccessibleState("enabled");
154 * Indicates that an object can accept focus, which means it will process
155 * keyboard events when focused.
157 * @see #FOCUSED
159 public static final AccessibleState FOCUSABLE
160 = new AccessibleState("focusable");
163 * Indicates that an object has keyboard focus.
165 * @see #FOCUSABLE
167 public static final AccessibleState FOCUSED
168 = new AccessibleState("focused");
171 * Indicates that an object is minimized to an icon.
173 * @see AccessibleRole#FRAME
174 * @see AccessibleRole#INTERNAL_FRAME
176 public static final AccessibleState ICONIFIED
177 = new AccessibleState("iconified");
180 * Indicates that the state of this particular object is
181 * indeterminate. This commonly occurs when an object is incapable
182 * of representing the state by a single value.
184 * @since 1.5
186 public static final AccessibleState INDETERMINATE
187 = new AccessibleState("indeterminate");
190 * Indicates that this particular object manages a number of
191 * subcomponents. This is a common property of structures such as
192 * trees and tables, which have a number of sub-elements such as
193 * rows and columns. The subcomponents should be left to the
194 * object, and not managed by the application.
196 * @since 1.5
198 public static final AccessibleState MANAGES_DESCENDANTS
199 = new AccessibleState("manages descendants");
202 * Indicates that something must be done in the current object before
203 * interaction is allowed on other windows, usually for dialogs.
205 * @see AccessibleRole#DIALOG
207 public static final AccessibleState MODAL
208 = new AccessibleState("modal");
211 * Indicates that all pixels in the object are painted. If this state is not
212 * present, then the object has some degree of transparency, letting lower
213 * panes show through.
215 * @see Accessible#getAccessibleContext()
216 * @see AccessibleContext#getAccessibleComponent()
217 * @see AccessibleComponent#getBounds()
219 public static final AccessibleState OPAQUE
220 = new AccessibleState("opaque");
223 * Indicates the size of this object is not fixed.
225 * @see Accessible#getAccessibleContext()
226 * @see AccessibleContext#getAccessibleComponent()
227 * @see AccessibleComponent#getSize()
228 * @see AccessibleComponent#setSize(Dimension)
230 public static final AccessibleState RESIZABLE
231 = new AccessibleState("resizable");
234 * Indicates that multiple children can be selected at once.
236 * @see Accessible#getAccessibleContext()
237 * @see AccessibleContext#getAccessibleSelection()
238 * @see AccessibleSelection
240 public static final AccessibleState MULTISELECTABLE
241 = new AccessibleState("multiselectable");
244 * Indicates that this child is one which can be selected from its parent.
246 * @see #SELECTED
247 * @see Accessible#getAccessibleContext()
248 * @see AccessibleContext#getAccessibleSelection()
249 * @see AccessibleSelection
251 public static final AccessibleState SELECTABLE
252 = new AccessibleState("selectable");
255 * Indicates that this child has been selected from its parent.
257 * @see #SELECTABLE
258 * @see Accessible#getAccessibleContext()
259 * @see AccessibleContext#getAccessibleSelection()
260 * @see AccessibleSelection
262 public static final AccessibleState SELECTED
263 = new AccessibleState("selected");
266 * Indicates that this object and all its parents are visible, so that it
267 * is on the screen. However, something opaque may be on top of it.
269 * @see #VISIBLE
271 public static final AccessibleState SHOWING
272 = new AccessibleState("showing");
275 * Indicates that this particular object is truncated when displayed
276 * visually.
278 * @since 1.5
280 public static final AccessibleState TRUNCATED
281 = new AccessibleState("truncated");
284 * Indicates that this object intends to be visible. However, if its
285 * parent is invisible, this object is as well.
287 * @see #SHOWING
289 public static final AccessibleState VISIBLE
290 = new AccessibleState("visible");
293 * Indicates that an object has vertical orientation.
295 * @see #HORIZONTAL
296 * @see AccessibleRole#SCROLL_BAR
297 * @see AccessibleRole#SLIDER
298 * @see AccessibleRole#PROGRESS_BAR
300 public static final AccessibleState VERTICAL
301 = new AccessibleState("vertical");
304 * Indicates that an object has horizontal orientation.
306 * @see #VERTICAL
307 * @see AccessibleRole#SCROLL_BAR
308 * @see AccessibleRole#SLIDER
309 * @see AccessibleRole#PROGRESS_BAR
311 public static final AccessibleState HORIZONTAL
312 = new AccessibleState("horizontal");
315 * Indicates that this text object can only hold a single line.
317 * @see #MULTI_LINE
319 public static final AccessibleState SINGLE_LINE
320 = new AccessibleState("single line");
323 * Indicates that this text object can hold multiple lines.
325 * @see #SINGLE_LINE
327 public static final AccessibleState MULTI_LINE
328 = new AccessibleState("multiple line");
331 * Indicates that this object is transient. This means the object is
332 * generated for method queries, but will never generate events, because
333 * its container (such as a tree, list, or table) does all the work.
335 public static final AccessibleState TRANSIENT
336 = new AccessibleState("transient");
339 * Create a new constant with a locale independent key. Follow the example,
340 * keep the constructor private and make public constants instead.
342 * @param key the name of the state
343 * @see #toDisplayString(String, Locale)
345 protected AccessibleState(String key)
347 this.key = key;
349 } // class AccessibleState