Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Need help to get ContextMenu for Shell Trim
Need help to get ContextMenu for Shell Trim [message #328612] Wed, 28 May 2008 15:44 Go to next message
Hongying is currently offline HongyingFriend
Messages: 11
Registered: July 2009
Junior Member
Hello,
I have a SashForm in my application, the left site of the SashForm is a
Composite, and it contains several TableViewer for easy navigation, I
just call it ShellTrim; On the right site of the SashForm, I have a
perspective with one or more views. I used eclipse 3.3 context menu
declare mechanism to declare a context menu for my views. The context
menu works well for the views.

I want the same context menu show up when I right mouse click on an item
from a TableViewer of ShellTrim. Since my ShellTrim is not a view, I
cannot register any context menu for it; and for some reason, I cannot
make it a view. Now, I have no idea how to hook the context menu with
my ShellTrim's TableViewer. I really appreciate any help and hint.

Thanks a lot !
Hongying Zhang
Re: Need help to get ContextMenu for Shell Trim [message #328923 is a reply to message #328612] Fri, 06 June 2008 18:09 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You might be able to create your own MenuManager and use the
IMenuService to populate it. If your view has any programmatic
contributions, you'll have to figure out a way to share those manually.

The one thing that won't work (at least not well) is standard object
contributions. Although if your view and ShellTrim were always open,
you can figure out a way for the view to provide ShellTrim with its own
separate context menu

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:org.eclipse.ui.commands defaultHandler isA?
Next Topic:Jface Accelerator Not working untill menu is popped once
Goto Forum:
  


Current Time: Fri Jul 19 14:32:58 GMT 2024

Powered by FUDForum. Page generated in 0.03193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top