[PATCH] 7186371: Main menu shortcuts not displayed (7u6 regression)
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Tue Sep 4 07:10:04 PDT 2012
Hi, Marco.
This issue was fixed in jdk8 and will be backported to 7u8 a little bit
later.
http://hg.openjdk.java.net/jdk8/awt/jdk/rev/f54660c18774
04.09.2012 18:01, Marco Dinacci wrote:
> Hello,
>
> the attached patch provides a workaround for bug
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7186371
>
> I discussed about this problem a while ago but my suggested change was
> causing bug #7160951.
> I'm reposting now this patch since I also proposed a patch to fix #7160951.
>
> The change consists simply in calling setAccelerator after calling
> setLabel since setLabel(String) resets all informations about the
> keyboard accelerator.
>
> --- a/src/macosx/classes/com/apple/laf/ScreenMenuItem.java Mon Jun 18
> 11:31:18 2012 +0100
> +++ b/src/macosx/classes/com/apple/laf/ScreenMenuItem.java Mon Jun 18
> 16:56:31 2012 +0100
> @@ -56,24 +56,23 @@ class ScreenMenuItem extends MenuItem im
>
> fMenuItem.addComponentListener(this);
> fListener = new ScreenMenuPropertyListener(this);
> fMenuItem.addPropertyChangeListener(fListener);
> addActionListener(this);
>
> setEnabled(fMenuItem.isEnabled());
>
> - // can't setState or setAccelerator or setIcon till we have a peer
> - setAccelerator(fMenuItem.getAccelerator());
> -
> final String label = fMenuItem.getText();
> if (label != null) {
> setLabel(label);
> }
>
> + setAccelerator(fMenuItem.getAccelerator());
> +
> final Icon icon = fMenuItem.getIcon();
> if (icon != null) {
> this.setIcon(icon);
> }
>
> final String tooltipText = fMenuItem.getToolTipText();
> if (tooltipText != null) {
> this.setToolTipText(tooltipText);
>
>
> Best,
> Marco
--
Best regards, Sergey.
More information about the macosx-port-dev
mailing list