1 /*
2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package javax.accessibility;
27 
28 import sun.awt.AWTAccessor;
29 import sun.awt.AppContext;
30 
31 import java.util.Locale;
32 import java.beans.PropertyChangeListener;
33 import java.beans.PropertyChangeSupport;
34 import java.beans.PropertyChangeEvent;
35 import java.awt.IllegalComponentStateException;
36 
37 /**
38  * AccessibleContext represents the minimum information all accessible objects
39  * return.  This information includes the accessible name, description, role,
40  * and state of the object, as well as information about its parent and
41  * children.  AccessibleContext also contains methods for
42  * obtaining more specific accessibility information about a component.
43  * If the component supports them, these methods will return an object that
44  * implements one or more of the following interfaces:
45  * <P><ul>
46  * <li>{@link AccessibleAction} - the object can perform one or more actions.
47  * This interface provides the standard mechanism for an assistive
48  * technology to determine what those actions are and tell the object
49  * to perform them.  Any object that can be manipulated should
50  * support this interface.
51  * <li>{@link AccessibleComponent} - the object has a graphical representation.
52  * This interface provides the standard mechanism for an assistive
53  * technology to determine and set the graphical representation of the
54  * object.  Any object that is rendered on the screen should support
55  * this interface.
56  * <li>{@link  AccessibleSelection} - the object allows its children to be
57  * selected.  This interface provides the standard mechanism for an
58  * assistive technology to determine the currently selected children of the object
59  * as well as modify its selection set.  Any object that has children
60  * that can be selected should support this interface.
61  * <li>{@link AccessibleText} - the object presents editable textual information
62  * on the display.  This interface provides the standard mechanism for
63  * an assistive technology to access that text via its content, attributes,
64  * and spatial location.  Any object that contains editable text should
65  * support this interface.
66  * <li>{@link AccessibleValue} - the object supports a numerical value.  This
67  * interface provides the standard mechanism for an assistive technology
68  * to determine and set the current value of the object, as well as obtain its
69  * minimum and maximum values.  Any object that supports a numerical value
70  * should support this interface.</ul>
71  *
72  *
73  * @beaninfo
74  *   attribute: isContainer false
75  * description: Minimal information that all accessible objects return
76  *
77 
78  * @author      Peter Korn
79  * @author      Hans Muller
80  * @author      Willie Walker
81  * @author      Lynn Monsanto
82  */
83 public abstract class AccessibleContext {
84 
85     /**
86      * The AppContext that should be used to dispatch events for this
87      * AccessibleContext
88      */
89     private volatile AppContext targetAppContext;
90 
91     static {
AWTAccessor.setAccessibleContextAccessor(new AWTAccessor.AccessibleContextAccessor() { @Override public void setAppContext(AccessibleContext accessibleContext, AppContext appContext) { accessibleContext.targetAppContext = appContext; } @Override public AppContext getAppContext(AccessibleContext accessibleContext) { return accessibleContext.targetAppContext; } })92         AWTAccessor.setAccessibleContextAccessor(new AWTAccessor.AccessibleContextAccessor() {
93             @Override
94             public void setAppContext(AccessibleContext accessibleContext, AppContext appContext) {
95                 accessibleContext.targetAppContext = appContext;
96             }
97 
98             @Override
99             public AppContext getAppContext(AccessibleContext accessibleContext) {
100                 return accessibleContext.targetAppContext;
101             }
102         });
103     }
104 
105    /**
106     * Constant used to determine when the accessibleName property has
107     * changed.  The old value in the PropertyChangeEvent will be the old
108     * accessibleName and the new value will be the new accessibleName.
109     *
110     * @see #getAccessibleName
111     * @see #addPropertyChangeListener
112     */
113    public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName";
114 
115    /**
116     * Constant used to determine when the accessibleDescription property has
117     * changed.  The old value in the PropertyChangeEvent will be the
118     * old accessibleDescription and the new value will be the new
119     * accessibleDescription.
120     *
121     * @see #getAccessibleDescription
122     * @see #addPropertyChangeListener
123     */
124    public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription";
125 
126    /**
127     * Constant used to determine when the accessibleStateSet property has
128     * changed.  The old value will be the old AccessibleState and the new
129     * value will be the new AccessibleState in the accessibleStateSet.
130     * For example, if a component that supports the vertical and horizontal
131     * states changes its orientation from vertical to horizontal, the old
132     * value will be AccessibleState.VERTICAL and the new value will be
133     * AccessibleState.HORIZONTAL.  Please note that either value can also
134     * be null.  For example, when a component changes from being enabled
135     * to disabled, the old value will be AccessibleState.ENABLED
136     * and the new value will be null.
137     *
138     * @see #getAccessibleStateSet
139     * @see AccessibleState
140     * @see AccessibleStateSet
141     * @see #addPropertyChangeListener
142     */
143    public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState";
144 
145    /**
146     * Constant used to determine when the accessibleValue property has
147     * changed.  The old value in the PropertyChangeEvent will be a Number
148     * representing the old value and the new value will be a Number
149     * representing the new value
150     *
151     * @see #getAccessibleValue
152     * @see #addPropertyChangeListener
153     */
154    public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue";
155 
156    /**
157     * Constant used to determine when the accessibleSelection has changed.
158     * The old and new values in the PropertyChangeEvent are currently
159     * reserved for future use.
160     *
161     * @see #getAccessibleSelection
162     * @see #addPropertyChangeListener
163     */
164    public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection";
165 
166    /**
167     * Constant used to determine when the accessibleText caret has changed.
168     * The old value in the PropertyChangeEvent will be an
169     * integer representing the old caret position, and the new value will
170     * be an integer representing the new/current caret position.
171     *
172     * @see #addPropertyChangeListener
173     */
174    public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret";
175 
176    /**
177     * Constant used to determine when the visual appearance of the object
178     * has changed.  The old and new values in the PropertyChangeEvent are
179     * currently reserved for future use.
180     *
181     * @see #addPropertyChangeListener
182     */
183    public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData";
184 
185    /**
186     * Constant used to determine when Accessible children are added/removed
187     * from the object.  If an Accessible child is being added, the old
188     * value will be null and the new value will be the Accessible child.  If an
189     * Accessible child is being removed, the old value will be the Accessible
190     * child, and the new value will be null.
191     *
192     * @see #addPropertyChangeListener
193     */
194    public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild";
195 
196    /**
197     * Constant used to determine when the active descendant of a component
198     * has changed.  The active descendant is used for objects such as
199     * list, tree, and table, which may have transient children.  When the
200     * active descendant has changed, the old value of the property change
201     * event will be the Accessible representing the previous active child, and
202     * the new value will be the Accessible representing the current active
203     * child.
204     *
205     * @see #addPropertyChangeListener
206     */
207    public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant";
208 
209     /**
210      * Constant used to indicate that the table caption has changed
211      * The old value in the PropertyChangeEvent will be an Accessible
212      * representing the previous table caption and the new value will
213      * be an Accessible representing the new table caption.
214      * @see Accessible
215      * @see AccessibleTable
216      */
217     public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED =
218         "accessibleTableCaptionChanged";
219 
220     /**
221      * Constant used to indicate that the table summary has changed
222      * The old value in the PropertyChangeEvent will be an Accessible
223      * representing the previous table summary and the new value will
224      * be an Accessible representing the new table summary.
225      * @see Accessible
226      * @see AccessibleTable
227      */
228     public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED =
229         "accessibleTableSummaryChanged";
230 
231     /**
232      * Constant used to indicate that table data has changed.
233      * The old value in the PropertyChangeEvent will be null and the
234      * new value will be an AccessibleTableModelChange representing
235      * the table change.
236      * @see AccessibleTable
237      * @see AccessibleTableModelChange
238      */
239     public static final String ACCESSIBLE_TABLE_MODEL_CHANGED =
240         "accessibleTableModelChanged";
241 
242     /**
243      * Constant used to indicate that the row header has changed
244      * The old value in the PropertyChangeEvent will be null and the
245      * new value will be an AccessibleTableModelChange representing
246      * the header change.
247      * @see AccessibleTable
248      * @see AccessibleTableModelChange
249      */
250     public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED =
251         "accessibleTableRowHeaderChanged";
252 
253     /**
254      * Constant used to indicate that the row description has changed
255      * The old value in the PropertyChangeEvent will be null and the
256      * new value will be an Integer representing the row index.
257      * @see AccessibleTable
258      */
259     public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED =
260         "accessibleTableRowDescriptionChanged";
261 
262     /**
263      * Constant used to indicate that the column header has changed
264      * The old value in the PropertyChangeEvent will be null and the
265      * new value will be an AccessibleTableModelChange representing
266      * the header change.
267      * @see AccessibleTable
268      * @see AccessibleTableModelChange
269      */
270     public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED =
271         "accessibleTableColumnHeaderChanged";
272 
273     /**
274      * Constant used to indicate that the column description has changed
275      * The old value in the PropertyChangeEvent will be null and the
276      * new value will be an Integer representing the column index.
277      * @see AccessibleTable
278      */
279     public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED =
280         "accessibleTableColumnDescriptionChanged";
281 
282     /**
283      * Constant used to indicate that the supported set of actions
284      * has changed.  The old value in the PropertyChangeEvent will
285      * be an Integer representing the old number of actions supported
286      * and the new value will be an Integer representing the new
287      * number of actions supported.
288      * @see AccessibleAction
289      */
290     public static final String ACCESSIBLE_ACTION_PROPERTY =
291         "accessibleActionProperty";
292 
293     /**
294      * Constant used to indicate that a hypertext element has received focus.
295      * The old value in the PropertyChangeEvent will be an Integer
296      * representing the start index in the document of the previous element
297      * that had focus and the new value will be an Integer representing
298      * the start index in the document of the current element that has
299      * focus.  A value of -1 indicates that an element does not or did
300      * not have focus.
301      * @see AccessibleHyperlink
302      */
303     public static final String ACCESSIBLE_HYPERTEXT_OFFSET =
304         "AccessibleHypertextOffset";
305 
306     /**
307      * PropertyChangeEvent which indicates that text has changed.
308      * <br>
309      * For text insertion, the oldValue is null and the newValue
310      * is an AccessibleTextSequence specifying the text that was
311      * inserted.
312      * <br>
313      * For text deletion, the oldValue is an AccessibleTextSequence
314      * specifying the text that was deleted and the newValue is null.
315      * <br>
316      * For text replacement, the oldValue is an AccessibleTextSequence
317      * specifying the old text and the newValue is an AccessibleTextSequence
318      * specifying the new text.
319      *
320      * @see #getAccessibleText
321      * @see #addPropertyChangeListener
322      * @see AccessibleTextSequence
323      */
324     public static final String ACCESSIBLE_TEXT_PROPERTY
325         = "AccessibleText";
326 
327     /**
328      * PropertyChangeEvent which indicates that a significant change
329      * has occurred to the children of a component like a tree or text.
330      * This change notifies the event listener that it needs to
331      * reacquire the state of the subcomponents. The oldValue is
332      * null and the newValue is the component whose children have
333      * become invalid.
334      *
335      * @see #getAccessibleText
336      * @see #addPropertyChangeListener
337      * @see AccessibleTextSequence
338      *
339      * @since 1.5
340      */
341     public static final String ACCESSIBLE_INVALIDATE_CHILDREN =
342         "accessibleInvalidateChildren";
343 
344      /**
345      * PropertyChangeEvent which indicates that text attributes have changed.
346      * <br>
347      * For attribute insertion, the oldValue is null and the newValue
348      * is an AccessibleAttributeSequence specifying the attributes that were
349      * inserted.
350      * <br>
351      * For attribute deletion, the oldValue is an AccessibleAttributeSequence
352      * specifying the attributes that were deleted and the newValue is null.
353      * <br>
354      * For attribute replacement, the oldValue is an AccessibleAttributeSequence
355      * specifying the old attributes and the newValue is an
356      * AccessibleAttributeSequence specifying the new attributes.
357      *
358      * @see #getAccessibleText
359      * @see #addPropertyChangeListener
360      * @see AccessibleAttributeSequence
361      *
362      * @since 1.5
363      */
364     public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED =
365         "accessibleTextAttributesChanged";
366 
367    /**
368      * PropertyChangeEvent which indicates that a change has occurred
369      * in a component's bounds.
370      * The oldValue is the old component bounds and the newValue is
371      * the new component bounds.
372      *
373      * @see #addPropertyChangeListener
374      *
375      * @since 1.5
376      */
377     public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED =
378         "accessibleComponentBoundsChanged";
379 
380     /**
381      * The accessible parent of this object.
382      *
383      * @see #getAccessibleParent
384      * @see #setAccessibleParent
385      */
386     protected Accessible accessibleParent = null;
387 
388     /**
389      * A localized String containing the name of the object.
390      *
391      * @see #getAccessibleName
392      * @see #setAccessibleName
393      */
394     protected String accessibleName = null;
395 
396     /**
397      * A localized String containing the description of the object.
398      *
399      * @see #getAccessibleDescription
400      * @see #setAccessibleDescription
401      */
402     protected String accessibleDescription = null;
403 
404     /**
405      * Used to handle the listener list for property change events.
406      *
407      * @see #addPropertyChangeListener
408      * @see #removePropertyChangeListener
409      * @see #firePropertyChangeListener
410      */
411     private PropertyChangeSupport accessibleChangeSupport = null;
412 
413     /**
414      * Used to represent the context's relation set
415      * @see #getAccessibleRelationSet
416      */
417     private AccessibleRelationSet relationSet
418         = new AccessibleRelationSet();
419 
420     private Object nativeAXResource;
421 
422     /**
423      * Gets the accessibleName property of this object.  The accessibleName
424      * property of an object is a localized String that designates the purpose
425      * of the object.  For example, the accessibleName property of a label
426      * or button might be the text of the label or button itself.  In the
427      * case of an object that doesn't display its name, the accessibleName
428      * should still be set.  For example, in the case of a text field used
429      * to enter the name of a city, the accessibleName for the en_US locale
430      * could be 'city.'
431      *
432      * @return the localized name of the object; null if this
433      * object does not have a name
434      *
435      * @see #setAccessibleName
436      */
getAccessibleName()437     public String getAccessibleName() {
438         return accessibleName;
439     }
440 
441     /**
442      * Sets the localized accessible name of this object.  Changing the
443      * name will cause a PropertyChangeEvent to be fired for the
444      * ACCESSIBLE_NAME_PROPERTY property.
445      *
446      * @param s the new localized name of the object.
447      *
448      * @see #getAccessibleName
449      * @see #addPropertyChangeListener
450      *
451      * @beaninfo
452      *    preferred:   true
453      *    description: Sets the accessible name for the component.
454      */
setAccessibleName(String s)455     public void setAccessibleName(String s) {
456         String oldName = accessibleName;
457         accessibleName = s;
458         firePropertyChange(ACCESSIBLE_NAME_PROPERTY,oldName,accessibleName);
459     }
460 
461     /**
462      * Gets the accessibleDescription property of this object.  The
463      * accessibleDescription property of this object is a short localized
464      * phrase describing the purpose of the object.  For example, in the
465      * case of a 'Cancel' button, the accessibleDescription could be
466      * 'Ignore changes and close dialog box.'
467      *
468      * @return the localized description of the object; null if
469      * this object does not have a description
470      *
471      * @see #setAccessibleDescription
472      */
getAccessibleDescription()473     public String getAccessibleDescription() {
474         return accessibleDescription;
475     }
476 
477     /**
478      * Sets the accessible description of this object.  Changing the
479      * name will cause a PropertyChangeEvent to be fired for the
480      * ACCESSIBLE_DESCRIPTION_PROPERTY property.
481      *
482      * @param s the new localized description of the object
483      *
484      * @see #setAccessibleName
485      * @see #addPropertyChangeListener
486      *
487      * @beaninfo
488      *    preferred:   true
489      *    description: Sets the accessible description for the component.
490      */
setAccessibleDescription(String s)491     public void setAccessibleDescription(String s) {
492         String oldDescription = accessibleDescription;
493         accessibleDescription = s;
494         firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
495                            oldDescription,accessibleDescription);
496     }
497 
498     /**
499      * Gets the role of this object.  The role of the object is the generic
500      * purpose or use of the class of this object.  For example, the role
501      * of a push button is AccessibleRole.PUSH_BUTTON.  The roles in
502      * AccessibleRole are provided so component developers can pick from
503      * a set of predefined roles.  This enables assistive technologies to
504      * provide a consistent interface to various tweaked subclasses of
505      * components (e.g., use AccessibleRole.PUSH_BUTTON for all components
506      * that act like a push button) as well as distinguish between subclasses
507      * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes
508      * and AccessibleRole.RADIO_BUTTON for radio buttons).
509      * <p>Note that the AccessibleRole class is also extensible, so
510      * custom component developers can define their own AccessibleRole's
511      * if the set of predefined roles is inadequate.
512      *
513      * @return an instance of AccessibleRole describing the role of the object
514      * @see AccessibleRole
515      */
getAccessibleRole()516     public abstract AccessibleRole getAccessibleRole();
517 
518     /**
519      * Gets the state set of this object.  The AccessibleStateSet of an object
520      * is composed of a set of unique AccessibleStates.  A change in the
521      * AccessibleStateSet of an object will cause a PropertyChangeEvent to
522      * be fired for the ACCESSIBLE_STATE_PROPERTY property.
523      *
524      * @return an instance of AccessibleStateSet containing the
525      * current state set of the object
526      * @see AccessibleStateSet
527      * @see AccessibleState
528      * @see #addPropertyChangeListener
529      */
getAccessibleStateSet()530     public abstract AccessibleStateSet getAccessibleStateSet();
531 
532     /**
533      * Gets the Accessible parent of this object.
534      *
535      * @return the Accessible parent of this object; null if this
536      * object does not have an Accessible parent
537      */
getAccessibleParent()538     public Accessible getAccessibleParent() {
539         return accessibleParent;
540     }
541 
542     /**
543      * Sets the Accessible parent of this object.  This is meant to be used
544      * only in the situations where the actual component's parent should
545      * not be treated as the component's accessible parent and is a method
546      * that should only be called by the parent of the accessible child.
547      *
548      * @param a - Accessible to be set as the parent
549      */
setAccessibleParent(Accessible a)550     public void setAccessibleParent(Accessible a) {
551         accessibleParent = a;
552     }
553 
554     /**
555      * Gets the 0-based index of this object in its accessible parent.
556      *
557      * @return the 0-based index of this object in its parent; -1 if this
558      * object does not have an accessible parent.
559      *
560      * @see #getAccessibleParent
561      * @see #getAccessibleChildrenCount
562      * @see #getAccessibleChild
563      */
getAccessibleIndexInParent()564     public abstract int getAccessibleIndexInParent();
565 
566     /**
567      * Returns the number of accessible children of the object.
568      *
569      * @return the number of accessible children of the object.
570      */
getAccessibleChildrenCount()571     public abstract int getAccessibleChildrenCount();
572 
573     /**
574      * Returns the specified Accessible child of the object.  The Accessible
575      * children of an Accessible object are zero-based, so the first child
576      * of an Accessible child is at index 0, the second child is at index 1,
577      * and so on.
578      *
579      * @param i zero-based index of child
580      * @return the Accessible child of the object
581      * @see #getAccessibleChildrenCount
582      */
getAccessibleChild(int i)583     public abstract Accessible getAccessibleChild(int i);
584 
585     /**
586      * Gets the locale of the component. If the component does not have a
587      * locale, then the locale of its parent is returned.
588      *
589      * @return this component's locale.  If this component does not have
590      * a locale, the locale of its parent is returned.
591      *
592      * @exception IllegalComponentStateException
593      * If the Component does not have its own locale and has not yet been
594      * added to a containment hierarchy such that the locale can be
595      * determined from the containing parent.
596      */
getLocale()597     public abstract Locale getLocale() throws IllegalComponentStateException;
598 
599     /**
600      * Adds a PropertyChangeListener to the listener list.
601      * The listener is registered for all Accessible properties and will
602      * be called when those properties change.
603      *
604      * @see #ACCESSIBLE_NAME_PROPERTY
605      * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
606      * @see #ACCESSIBLE_STATE_PROPERTY
607      * @see #ACCESSIBLE_VALUE_PROPERTY
608      * @see #ACCESSIBLE_SELECTION_PROPERTY
609      * @see #ACCESSIBLE_TEXT_PROPERTY
610      * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
611      *
612      * @param listener  The PropertyChangeListener to be added
613      */
addPropertyChangeListener(PropertyChangeListener listener)614     public void addPropertyChangeListener(PropertyChangeListener listener) {
615         if (accessibleChangeSupport == null) {
616             accessibleChangeSupport = new PropertyChangeSupport(this);
617         }
618         accessibleChangeSupport.addPropertyChangeListener(listener);
619     }
620 
621     /**
622      * Removes a PropertyChangeListener from the listener list.
623      * This removes a PropertyChangeListener that was registered
624      * for all properties.
625      *
626      * @param listener  The PropertyChangeListener to be removed
627      */
removePropertyChangeListener(PropertyChangeListener listener)628     public void removePropertyChangeListener(PropertyChangeListener listener) {
629         if (accessibleChangeSupport != null) {
630             accessibleChangeSupport.removePropertyChangeListener(listener);
631         }
632     }
633 
634     /**
635      * Gets the AccessibleAction associated with this object that supports
636      * one or more actions.
637      *
638      * @return AccessibleAction if supported by object; else return null
639      * @see AccessibleAction
640      */
getAccessibleAction()641     public AccessibleAction getAccessibleAction() {
642         return null;
643     }
644 
645     /**
646      * Gets the AccessibleComponent associated with this object that has a
647      * graphical representation.
648      *
649      * @return AccessibleComponent if supported by object; else return null
650      * @see AccessibleComponent
651      */
getAccessibleComponent()652     public AccessibleComponent getAccessibleComponent() {
653         return null;
654     }
655 
656     /**
657      * Gets the AccessibleSelection associated with this object which allows its
658      * Accessible children to be selected.
659      *
660      * @return AccessibleSelection if supported by object; else return null
661      * @see AccessibleSelection
662      */
getAccessibleSelection()663     public AccessibleSelection getAccessibleSelection() {
664         return null;
665     }
666 
667     /**
668      * Gets the AccessibleText associated with this object presenting
669      * text on the display.
670      *
671      * @return AccessibleText if supported by object; else return null
672      * @see AccessibleText
673      */
getAccessibleText()674     public AccessibleText getAccessibleText() {
675         return null;
676     }
677 
678     /**
679      * Gets the AccessibleEditableText associated with this object
680      * presenting editable text on the display.
681      *
682      * @return AccessibleEditableText if supported by object; else return null
683      * @see AccessibleEditableText
684      * @since 1.4
685      */
getAccessibleEditableText()686     public AccessibleEditableText getAccessibleEditableText() {
687         return null;
688     }
689 
690 
691     /**
692      * Gets the AccessibleValue associated with this object that supports a
693      * Numerical value.
694      *
695      * @return AccessibleValue if supported by object; else return null
696      * @see AccessibleValue
697      */
getAccessibleValue()698     public AccessibleValue getAccessibleValue() {
699         return null;
700     }
701 
702     /**
703      * Gets the AccessibleIcons associated with an object that has
704      * one or more associated icons
705      *
706      * @return an array of AccessibleIcon if supported by object;
707      * otherwise return null
708      * @see AccessibleIcon
709      * @since 1.3
710      */
getAccessibleIcon()711     public AccessibleIcon [] getAccessibleIcon() {
712         return null;
713     }
714 
715     /**
716      * Gets the AccessibleRelationSet associated with an object
717      *
718      * @return an AccessibleRelationSet if supported by object;
719      * otherwise return null
720      * @see AccessibleRelationSet
721      * @since 1.3
722      */
getAccessibleRelationSet()723     public AccessibleRelationSet getAccessibleRelationSet() {
724         return relationSet;
725     }
726 
727     /**
728      * Gets the AccessibleTable associated with an object
729      *
730      * @return an AccessibleTable if supported by object;
731      * otherwise return null
732      * @see AccessibleTable
733      * @since 1.3
734      */
getAccessibleTable()735     public AccessibleTable getAccessibleTable() {
736         return null;
737     }
738 
739     /**
740      * Support for reporting bound property changes.  If oldValue and
741      * newValue are not equal and the PropertyChangeEvent listener list
742      * is not empty, then fire a PropertyChange event to each listener.
743      * In general, this is for use by the Accessible objects themselves
744      * and should not be called by an application program.
745      * @param propertyName  The programmatic name of the property that
746      * was changed.
747      * @param oldValue  The old value of the property.
748      * @param newValue  The new value of the property.
749      * @see java.beans.PropertyChangeSupport
750      * @see #addPropertyChangeListener
751      * @see #removePropertyChangeListener
752      * @see #ACCESSIBLE_NAME_PROPERTY
753      * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
754      * @see #ACCESSIBLE_STATE_PROPERTY
755      * @see #ACCESSIBLE_VALUE_PROPERTY
756      * @see #ACCESSIBLE_SELECTION_PROPERTY
757      * @see #ACCESSIBLE_TEXT_PROPERTY
758      * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
759      */
firePropertyChange(String propertyName, Object oldValue, Object newValue)760     public void firePropertyChange(String propertyName,
761                                    Object oldValue,
762                                    Object newValue) {
763         if (accessibleChangeSupport != null) {
764             if (newValue instanceof PropertyChangeEvent) {
765                 PropertyChangeEvent pce = (PropertyChangeEvent)newValue;
766                 accessibleChangeSupport.firePropertyChange(pce);
767             } else {
768                 accessibleChangeSupport.firePropertyChange(propertyName,
769                                                            oldValue,
770                                                            newValue);
771             }
772         }
773     }
774 }
775