This patch (committed) implements the stub method getAccessibleStateSet() by simply calling super.getAccessibleStateSet(). I ran some tests against the reference implementation, but none of the JToolBar specific attributes seem to affect the AccessibleStateSet.

I also updated some API docs as noted:

2006-04-17  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JToolBar.java
        (AccessibleJToolBar.AccessibleJToolBar()): Updated API docs,
        (AccessibleJToolBar.getAccessibleStateSet): Implemented,
        (AccessibleJToolBar.getAccessibleRole): Updated API docs,
        (getAccessibleContext): Likewise.

Regards,

Dave
Index: javax/swing/JToolBar.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JToolBar.java,v
retrieving revision 1.16
diff -u -r1.16 JToolBar.java
--- javax/swing/JToolBar.java   13 Apr 2006 16:20:39 -0000      1.16
+++ javax/swing/JToolBar.java   17 Apr 2006 21:20:49 -0000
@@ -38,8 +38,6 @@
 
 package javax.swing;
 
-import gnu.classpath.NotImplementedException;
-
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
@@ -67,17 +65,15 @@
 public class JToolBar extends JComponent implements SwingConstants, Accessible
 {
   /**
-   * AccessibleJToolBar
+   * Provides the accessibility features for the <code>JToolBar</code>
+   * component.
    */
-  // FIXME: This inner class is a complete stub and must be implemented
-  // properly.
   protected class AccessibleJToolBar extends AccessibleJComponent
   {
-    /** DOCUMENT ME! */
     private static final long serialVersionUID = -5516888265903814215L;
 
     /**
-     * Constructor AccessibleJToolBar
+     * Creates a new <code>AccessibleJToolBar</code> instance.
      */
     protected AccessibleJToolBar()
     {
@@ -85,20 +81,23 @@
     }
 
     /**
-     * getAccessibleStateSet
+     * Returns a set containing the current state of the [EMAIL PROTECTED] 
JToolBar} 
+     * component.  The current implementation simply calls the superclass.
      *
-     * @return AccessibleStateSet
+     * @return The accessible state set.
      */
     public AccessibleStateSet getAccessibleStateSet()
-      throws NotImplementedException
     {
-      return null; // TODO
+      // running tests against the reference implementation, I was unable
+      // to find any state information that is set specifically by the
+      // tool bar...
+      return super.getAccessibleStateSet();
     }
 
     /**
-     * getAccessibleRole
+     * Returns the accessible role for the <code>JToolBar</code> component.
      *
-     * @return AccessibleRole
+     * @return [EMAIL PROTECTED] AccessibleRole#TOOL_BAR}.
      */
     public AccessibleRole getAccessibleRole()
     {
@@ -768,9 +767,10 @@
   } // paramString()
 
   /**
-   * getAccessibleContext
+   * Returns the object that provides accessibility features for this
+   * <code>JToolBar</code> component.
    *
-   * @return AccessibleContext
+   * @return The accessible context (an instance of [EMAIL PROTECTED] 
AccessibleJToolBar}).
    */
   public AccessibleContext getAccessibleContext()
   {

Reply via email to