This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

BasicMenUI calls protected JMenu methods


Hi,

While integrating the latest gui-branch drop into GNU Classpath and
testing with the jikes 2.21 compiler I noticed that BasicMenUI calls two
protected JMenu methods. I fixed those by just removing them:

2004-06-26  Mark Wielaard  <mark@klomp.org>

        * javax/swing/plaf/basic/BasicMenuUI.java (mousePressed): Don't call
        protected JMenu methods fireMenuCanceled() and fireMenuSelected().

It looks like the MenuSelectionManager should take care of this when
clearSelectedPath() or setSelectedPath() is called.

Unfortunately I don't have any test program to check this patch.
I have checked it into GNU Classpath for the moment.
Could one of the Swing gui wizards take a look at this?

Thanks,

Mark
Index: javax/swing/plaf/basic/BasicMenuUI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicMenuUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicMenuUI.java
--- javax/swing/plaf/basic/BasicMenuUI.java	17 Jun 2004 23:43:13 -0000	1.5
+++ javax/swing/plaf/basic/BasicMenuUI.java	26 Jun 2004 13:24:19 -0000
@@ -342,7 +342,6 @@
 	    {
 	      // If menu is visible and menu button was pressed.. 
 	      // then need to cancel the menu
-	      menu.fireMenuCanceled();
 	      manager.clearSelectedPath();
 	    }
 	  else
@@ -351,7 +350,6 @@
 	      int x = 0;
 	      int y = menu.getHeight();
 
-	      menu.fireMenuSelected();
 	      manager.setSelectedPath(getPath());
 
 	      JMenuBar mb = (JMenuBar) menu.getParent();

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]