[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: Fix for #13636
From: |
Robert Schuster |
Subject: |
[cp-patches] FYI: Fix for #13636 |
Date: |
Fri, 08 Jul 2005 02:25:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.8) Gecko/20050514 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
this patch will prevent opening a JMenu's popup when it is disabled.
However the behavior of the JDK for JMenu is not fully matched. I file
bug reports for this.
2005-07-07 Robert Schuster <address@hidden>
* javax/swing/JMenu.java
(setSelected): Added isEnabled() to expression.
cu
Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFCzcgNG9cfwmwwEtoRAvWxAJ46j1iWrQ00UDVPd2SmSXl6AZsZaQCfQJi6
eRhpafuaTn38dhOq5+pF74A=
=7rf0
-----END PGP SIGNATURE-----
Index: javax/swing/JMenu.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JMenu.java,v
retrieving revision 1.17
diff -u -r1.17 JMenu.java
--- javax/swing/JMenu.java 2 Jul 2005 20:32:47 -0000 1.17
+++ javax/swing/JMenu.java 8 Jul 2005 00:19:45 -0000
@@ -339,17 +339,23 @@
*/
public void setSelected(boolean selected)
{
- // if this menu selection is true, then activate this menu and
- // display popup associated with this menu
- if (selected)
+ // If menu is selected and enabled, activates the menu and
+ // displays associated popup.
+ if (selected && isEnabled())
{
super.setArmed(true);
super.setSelected(true);
+ // FIXME: The reference implementation behaves different here. When
+ // calling setSelected(true) it will *not* open the popup but appear
+ // selected. This is even true when the menu is disabled. Our
+ // implementation will always open the popup (when enabled) and
+ // will not appear selected when disabled.
+
// FIXME: The popup menu should be shown on the screen after certain
// number of seconds pass. The 'delay' property of this menu indicates
// this amount of seconds. 'delay' property is 0 by default.
- if (this.isShowing())
+ if (isShowing())
{
fireMenuSelected();
@@ -893,4 +899,5 @@
// FIXME: Need to implement
}
}
+
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: Fix for #13636,
Robert Schuster <=