This patch (committed) adds/updates API docs for the JButton class:

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

        * javax/swing/JButton.java: Updated API docs all over.

I also removed a comment from the configurePropertiesFromAction() method that looks like a cut-and-paste from Sun's API docs.

Regards,

Dave
Index: javax/swing/JButton.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JButton.java,v
retrieving revision 1.25
diff -u -r1.25 JButton.java
--- javax/swing/JButton.java    25 Mar 2006 00:01:59 -0000      1.25
+++ javax/swing/JButton.java    19 Apr 2006 20:56:31 -0000
@@ -1,5 +1,5 @@
 /* JButton.java --
-   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -78,27 +78,57 @@
    */
   private boolean defaultCapable;
 
+  /**
+   * Creates a new button with an empty string for the button text and no
+   * icon.
+   */
   public JButton()
   {
     this(null, null);
   }
 
+  /**
+   * Creates a new button from the specified action.
+   * 
+   * @param a  the action (<code>null</code> permitted).
+   * 
+   * @see AbstractButton#setAction(Action)
+   */
   public JButton(Action a)
   {
     this();
     setAction(a);
   }
 
+  /**
+   * Creates a new button with the specified icon (and an empty string for
+   * the button text).
+   * 
+   * @param icon  the icon (<code>null</code> permitted).
+   */
   public JButton(Icon icon)
   {
     this(null, icon);
   }
 
+  /**
+   * Creates a new button with the specified text and no icon.
+   * 
+   * @param text  the button text (<code>null</code> permitted, will be
+   *     substituted by an empty string).
+   */
   public JButton(String text)
   {
     this(text, null);
   }
 
+  /**
+   * Creates a new button with the specified text and icon.
+   * 
+   * @param text  the button text (<code>null</code> permitted, will be
+   *     substituted by an empty string).
+   * @param icon  the icon (<code>null</code> permitted).
+   */
   public JButton(String text, Icon icon)
   {
     super();
@@ -108,12 +138,16 @@
   }
 
   protected void configurePropertiesFromAction(Action a)
-  {
-    // Factory method which sets the AbstractButton's properties according to
-    // values from the Action instance. 
+  { 
     super.configurePropertiesFromAction(a);
   }
 
+  /**
+   * Returns the object that provides accessibility features for this
+   * <code>JButton</code> component.
+   *
+   * @return The accessible context (an instance of [EMAIL PROTECTED] 
AccessibleJButton}).
+   */
   public AccessibleContext getAccessibleContext()
   {
     if (accessibleContext == null)
@@ -121,6 +155,13 @@
     return accessibleContext;
   }
 
+  /**
+   * Returns the suffix (<code>"ButtonUI"</code> in this case) used to 
+   * determine the class name for a UI delegate that can provide the look and 
+   * feel for a <code>JButton</code>.
+   *
+   * @return <code>"ButtonUI"</code>.
+   */
   public String getUIClassID()
   {
     // Returns a string that specifies the name of the L&F class that renders
@@ -138,7 +179,7 @@
    *         its <code>JRootPane</code>
    *
    * @see #isDefaultCapable()
-   * @see #setDefaultCapable()
+   * @see #setDefaultCapable(boolean)
    * @see JRootPane#getDefaultButton()
    * @see JRootPane#setDefaultButton(JButton)
    */
@@ -160,7 +201,7 @@
    *
    * @return <code>true</code> if this button can act as the default button
    *
-   * @see #setDefaultCapable()
+   * @see #setDefaultCapable(boolean)
    * @see #isDefaultButton()
    * @see JRootPane#getDefaultButton()
    * @see JRootPane#setDefaultButton(JButton)
@@ -172,6 +213,13 @@
     return defaultCapable;
   }
 
+  /**
+   * Returns an implementation-dependent string describing the attributes of
+   * this <code>JButton</code>.
+   *
+   * @return A string describing the attributes of this <code>JButton</code>
+   *         (never <code>null</code>).
+   */
   protected String paramString()
   {
     String superParam = super.paramString();
@@ -205,7 +253,7 @@
    * @param defaultCapable <code>true</code> if this button can become the
    *        default button in its JRootPane, <code>false</code> otherwise
    *
-   * @see #setDefaultCapable()
+   * @see #setDefaultCapable(boolean)
    * @see #isDefaultButton()
    * @see JRootPane#getDefaultButton()
    * @see JRootPane#setDefaultButton(JButton)
@@ -215,6 +263,10 @@
     this.defaultCapable = defaultCapable;
   }
 
+  /**
+   * Sets this button's UI delegate to the default (obtained from the
+   * [EMAIL PROTECTED] UIManager}) for the current look and feel.
+   */
   public void updateUI()
   {
     setUI((ButtonUI) UIManager.getUI(this));

Reply via email to