Bug 242357 - [Commands] [regression] Cannot Modify, Menu created by IMenuCreator inside Job/Display.asyncExec()
Summary: [Commands] [regression] Cannot Modify, Menu created by IMenuCreator inside Jo...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on: 306320
Blocks:
  Show dependency tree
 
Reported: 2008-07-29 06:10 EDT by Srimathi CLA
Modified: 2021-10-10 13:45 EDT (History)
3 users (show)

See Also:


Attachments
source code of TestActionDelegate (2.34 KB, text/plain)
2008-07-29 06:10 EDT, Srimathi CLA
no flags Details
Test App source code (23.90 KB, application/x-zip-compressed)
2008-07-29 08:48 EDT, Srimathi CLA
no flags Details
Patch v 0.1 (1.92 KB, patch)
2010-03-30 05:02 EDT, Prakash Rangaraj CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srimathi CLA 2008-07-29 06:10:20 EDT
Created attachment 108625 [details]
source code of TestActionDelegate 

I have the following Object Contribution in plugin.xml
<extension point="org.eclipse.ui.popupMenus"> 
   <objectContribution
         adaptable="false"
         id="com.alcatel.axs.gui.platform-trunk-SNAPSHOT.objectContribution1"
         objectClass="com.alcatel.axs.gui.platform.views.navigation.IIdentificationProvider">
      <action
            class="com.alcatel.axs.gui.platform.base.TestActionDelegate"
            enablesFor="1"
            id="com.alcatel.axs.gui.platform-trunk-SNAPSHOT.action1"
            label="TestAction"
            style="pulldown">
      </action>
   </objectContribution>
  </extension>

And I have TestActionDelegate which builds the dynamic Menu.
Please see the attachement for source code.
In Eclipse 3.4.0, The menu modifications done inside the ( Job and Display.syncExec() inside Job ) OR Display.asyncExec() are not shown in GUI.

*** Note:: These modifications are visible in Eclipse 3.2.1 but NOT in  eclipse 3.4.0.
Comment 1 Srimathi CLA 2008-07-29 08:48:51 EDT
Created attachment 108640 [details]
Test App source code
Comment 2 Srimathi CLA 2008-07-29 08:50:04 EDT
More Info.

This menu modifications are not shown only for the first time. WHen i cheked in debug, the modification are not shown because, the current Menu Object (this) and shell.activeMenu were not same. (May be this could be a clue)

public boolean getVisible () {
	checkWidget ();
	if ((style & SWT.BAR) != 0) {
		return this == parent.menuShell ().menuBar;
	}
	if ((style & SWT.POP_UP) != 0) {
		Menu [] popups = display.popups;
		if (popups == null) return false;
		for (int i=0; i<popups.length; i++) {
			if (popups [i] == this) return true;
		}
	}
	Shell shell = getShell ();
	Menu menu = shell.activeMenu; 
	while (menu != null && menu != this) { //******Problem here
		menu = menu.getParentMenu ();
	}
	return this == menu;
}

Please fine the attached app source code for standalone application of the same issue.

Thanks,
Mathi
Comment 3 Paul Webster CLA 2009-03-02 11:41:49 EST
Updated as per http://wiki.eclipse.org/Platform_UI/Bug_Triage
PW
Comment 4 Paul Webster CLA 2009-11-25 13:00:24 EST
This is related to the work done in org.eclipse.jface.action.ActionContributionItem.handleShowProxy(Menu) for bug 136397 and bug 189092

The first time a pulldown menu is shown, the real SWT Menu is created from the pulldown delegate and then copied, and the copy is displayed.  When you then update the real menu the first time, the copy is not updated.

After the first time, it doesn't involve the proxy menu and so it works as expected.

PW
Comment 5 Prakash Rangaraj CLA 2010-03-19 01:18:59 EDT
Later, not for 3.6
Comment 6 Prakash Rangaraj CLA 2010-03-30 05:02:48 EDT
Created attachment 163380 [details]
Patch v 0.1

Working copy. 

Added a SWT.Skin listener to display (earlier I was attaching it to Menu), we seem to get the menu creation. Copying the menu doesn't work. Attaching the patch to revisit this bug later.
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:09:15 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 8 Eclipse Genie CLA 2021-10-10 13:45:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.