Dynamic cacading menu items [message #663624] |
Tue, 05 April 2011 22:03 |
|
I would like to create dynamic cascading menu items as follows:
When the user hovers over menu item A, it shows dynamic sub menu items b1, b2 and b3. On hovering over b1, it will show dynamic sub menu items c1 and c2 (similarly for b2 and b3). Is it possible to create a dynamic submenu under a dynamic submenu item? If so, is there an example?
Thanks!
|
|
|
|
|
|
Re: Dynamic cacading menu items [message #664760 is a reply to message #664084] |
Mon, 11 April 2011 20:56 |
|
Ok...This is what I wish to do.
I have added a menu under "Project". I am adding a new dynamic under the menu. Under dynamic I add a new class which extends CompoundContributionItem. This would look something like
org.eclipse.ui.menus
|
|==== menu:project?after=additions (menuContribution)
|
|==== <menu> (menu)
|
|==== <dynamic> (dynamic)
|
|==== <CompoundContributionCommand> (class)
I override getContributionItems() in my class which returns contribution items. Each of these items return other contribution items thus making it a dynamic cascading menu. I was wondering if there is a way to do it or if I could find a snippet somewhere.
Thanks for your help.
|
|
|
|
Re: Dynamic cacading menu items [message #665280 is a reply to message #664882] |
Thu, 14 April 2011 06:16 |
|
Thank you very much for your help! It worked.
I have one more question pertaining to this. If I want to change the style of menu item (from SWT_PUSH to SWT_CHECK), can I change it on the MenuManager? I am returning menu managers in getContributionItems. Is there any way to do it in my scenario?
Thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.03079 seconds