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