This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208081

Summary: Node's Action Popup Menu does never show icon
Product: platform Reporter: anchialos <anchialos>
Component: NodesAssignee: Jan Peska <JPESKA>
Status: REOPENED ---    
Severity: normal CC: markiewb, ramis, stophi
Priority: P3    
Version: 7.1   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: patch / tests / changes to arch.xml

Description anchialos 2012-02-06 10:57:43 UTC
The node's action context popup menu does not display icons. 

The involved DefaultAWTBridge#createPopupPresenter(Action) is creating the popup menu items by 
   new Actions.MenuItem(action, false);
and its constructor is calling
    Actions.connect(this, aAction, true); 

The subsequent call to Actions$MenuBridge#updateState(String) will not invoke updateButtonIcon() since popup == true.

There is Workaround (implementing an own ActionPresenterProvider with patched createPopupPresenter(Action) implementation) but I think this should be fixed in the NB classes!
Comment 1 Jaroslav Tulach 2012-02-09 10:24:49 UTC
Imho you can use the branding as available in 7.1:

The description of the API was miscategorized, so I fixed that in core-main#85ed663a706d

Also I added link to the API from Actions javadoc: core-main#1ce19028a675
Comment 2 Geertjan Wielenga 2012-02-09 10:38:58 UTC
Here's my blog entry on this:

But I didn't know this had anything to do with icons. Why/how should it have anything to do with icons?
Comment 3 Jaroslav Tulach 2012-02-09 17:39:56 UTC
I see. This has obviously nothing to do with icons, only mnemonics. I am not sure what I was thinking about!

> There is Workaround (implementing an own ActionPresenterProvider with patched
> createPopupPresenter(Action) implementation) but I think this should be fixed
> in the NB classes!

Sure, in such case a patch donation is welcomed.
Comment 4 Jaroslav Tulach 2012-02-24 15:25:12 UTC
I am still waiting for the patch.
Comment 5 Jaroslav Tulach 2012-03-05 09:28:50 UTC
I am still waiting. Meanwhile closing as won'tfix to get this out of my bug statistic. Reopen when the patch is ready.
Comment 6 ramis 2012-06-09 10:24:47 UTC

contains the code:

if (!popup) {
    if ((changedProperty == null) ||
           changedProperty.equals(SystemAction.PROP_ICON) ||
           changedProperty.equals(Action.SMALL_ICON) ||
           changedProperty.equals("iconBase")) { // NOI18N

This generally disables icons in context popup menus.
An easy fix that doesn't change the old behavior but allows users to globally switch to context popup menus with icons would be to introduce a boolean system property 'hideIconInPopup=true'
and change
if (!popup) {
if (!(popup && hideIconInPopup)) {

On the other hand popular programs like Windows Explorer or OpenOffice also use icons in context menus, so this behavior is quite common.
So simply removing the first if statement might also be an option.
Comment 7 Jaroslav Tulach 2012-06-14 11:55:26 UTC
I'd rather use the branding approach, similar to

I am still waiting for real patch, with test, and changes to arch.xml file.
Comment 8 ramis 2012-06-21 01:37:00 UTC
Created attachment 121131 [details]
patch / tests / changes to arch.xml

Here is the patch using the branding approach - I made everything similar to the mnemonics stuff you mentioned.

Some notes:
- I did not change the Api changes document
- I added this feature with stability "stable", since I couldn't imagine anything being changed (if this patch is applied). Is that correct?

Is there an easy way to provide branding for NetBeans IDE without building it?
Comment 9 ramis 2012-06-21 02:03:17 UTC
I forget to mention, the testTooltipsContainAccelerator test failed already before the patch