This patch (committed) makes the getHelpMenu() method in the JMenuBar class throw an error to match the reference implementation, and updates some API docs in a couple of other methods:

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

        * javax/swing/JMenuBar.java
        (getHelpMenu): Implemented to throw an Error, and added API docs,
        (getMargin): Added API docs,
        (setMargin): Likewise.

Regards,

Dave
Index: javax/swing/JMenuBar.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JMenuBar.java,v
retrieving revision 1.25
diff -u -r1.25 JMenuBar.java
--- javax/swing/JMenuBar.java   7 Jun 2006 20:29:41 -0000       1.25
+++ javax/swing/JMenuBar.java   19 Sep 2006 14:38:16 -0000
@@ -298,19 +298,25 @@
   }
 
   /**
-   * DOCUMENT ME!
+   * This method is not implemented and will throw an [EMAIL PROTECTED] Error} 
if called.
    *
-   * @return DOCUMENT ME!
+   * @return This method never returns anything, it throws an exception.
    */
   public JMenu getHelpMenu()
   {
-    return null;
+    // the following error matches the behaviour of the reference 
+    // implementation...
+    throw new Error("getHelpMenu() is not implemented");
   }
 
   /**
-   * Returns margin betweeen menu bar's border and its menues
+   * Returns the margin between the menu bar's border and its menus.  If the
+   * margin is <code>null</code>, this method returns 
+   * <code>new Insets(0, 0, 0, 0)</code>.
    *
-   * @return margin between menu bar's border and its menues
+   * @return The margin (never <code>null</code>).
+   * 
+   * @see #setMargin(Insets)
    */
   public Insets getMargin()
   {
@@ -617,21 +623,20 @@
   }
 
   /**
-   * Sets the menu bar's "margin" bound property,  which represents
-   * distance between the menubar's border and its menus.
-   * icon. When marging property is modified, PropertyChangeEvent will
-   * be fired to menuBar's PropertyChangeListener's.
-   *
-   * @param m distance between the menubar's border and its menus.
+   * Sets the margin between the menu bar's border and its menus (this is a
+   * bound property with the name 'margin').
    *
+   * @param m  the margin (<code>null</code> permitted).
+   * 
+   * @see #getMargin()
    */
   public void setMargin(Insets m)
   {
     if (m != margin)
       {
-       Insets oldMargin = margin;
-       margin = m;
-       firePropertyChange("margin", oldMargin, margin);
+        Insets oldMargin = margin;
+        margin = m;
+        firePropertyChange("margin", oldMargin, margin);
       }
   }
 

Reply via email to