|Dynamically expanding sub-menu on right click [message #541348]
||Sun, 20 June 2010 07:14
| Martin R
Registered: January 2010
First of all, let me explain what I try to do, then how I think it could be done and what my problems are.
So, what I want to do is have a possibility to group files for later use. So we might have file a and b in group 1, file c, f and h in group 2 etc. There is no fixed number of groups, so I need to be able to expand the number of groups dynamically
Now I imagined I could have a sub-menu on the right click in the project explorer with initially just 2 entries "1" and "2" for the group number. The user can then start to add files to those groups, but when group 2 has more than 0 members, a third entry appears in the menu and so on.
So, first of all, how would I go about adding such a sub-menu to the right-click? I know can add an entry by extending org.eclipse.ui.menus and adding a menucontribution to URI popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu , but then I am stumped.
Another problem I see is adding menu items during runtime. Is that possible and if yes, how would it be done?
Thanks in advance for any help you can offer,
Powered by FUDForum
. Page generated in 0.01732 seconds