Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333571 - public void menuShown method is not working for addMenuListener
Summary: public void menuShown method is not working for addMenuListener
Status: RESOLVED INVALID
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-05 09:52 EST by Dharmang CLA
Modified: 2011-01-05 11:46 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dharmang CLA 2011-01-05 09:52:47 EST
Build Identifier: Eclipse 3.6

IWorkbench workbench = Activator.getDefault().getWorkbench(); //PlatformUI.getWorkbench(); 
		Menu menubar = workbench.getActiveWorkbenchWindow().getShell().getMenuBar();		
		
		menubar.addMenuListener(new MenuListener() {			

			@Override
			public void menuShown(MenuEvent arg0) {		
								
							}
			
			@Override
			public void menuHidden(MenuEvent arg0) {				
			}			
		});

I tried the above code and it never calls the "public void menuShown(MenuEvent arg0)" method.

Reproducible: Always
Comment 1 Remy Suen CLA 2011-01-05 09:54:38 EST
(In reply to comment #0)
> I tried the above code and it never calls the "public void menuShown(MenuEvent
> arg0)" method.

Menu bars are only ever shown once.
Comment 2 Dharmang CLA 2011-01-05 10:01:29 EST
(In reply to comment #1)
> (In reply to comment #0)
> > I tried the above code and it never calls the "public void menuShown(MenuEvent
> > arg0)" method.
> Menu bars are only ever shown once.

Then what is the perpose of adding the method in Listner..?

I want to change the name of My Menu Item on selecting the parent menu. What should I do?
Comment 3 Remy Suen CLA 2011-01-05 10:06:58 EST
(In reply to comment #2)
> Then what is the perpose of adding the method in Listner..?

Other menus can be shown repeatedly (think "dropdown" and popup menus).

> I want to change the name of My Menu Item on selecting the parent menu. What
> should I do?

Please ask your question on the forums.
http://www.eclipse.org/forums/
Comment 4 Curtis Windatt CLA 2011-01-05 11:46:06 EST
This is not a bug.  Please ask questions on the forum/newsgroup.

Closing as INVALID.