Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ObjectActionDelegate or Command ???
ObjectActionDelegate or Command ??? [message #332516] Fri, 24 October 2008 14:53 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all. hope someone can tell me what is the right approach to solve my
problem .

I have got two different view:

- ID: Com.test.view.v1
- ID: Com.test.view.v2

Each view display, one in a TreeViewer and one in a TableViewer information
using the same object MyObject. From both views I can act on the selected
items with common operation like lock / unlock /delete


Now, what is the best approach for creating this action? (eclipse 3.3)

- Define (ie) LockAction implements IObjectActionDelegate

or

- Define a command?

If I'm using a command, I need to use the ui.menu extension point and use
TWO menucontribution with the schema popup (one for each view)

- is there a way to define menucontribution locationuri:
popup:com.test.view.* (I cannot use the popup.any because I have got other
view in the plugin)
- or enable the command only if the selection contains specific object
(myobject)

Thanks
Kar
Re: ObjectActionDelegate or Command ??? [message #332521 is a reply to message #332516] Fri, 24 October 2008 19:35 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can use registerContextMenu(*) with the same ID in both views, and
then your popup:view.common.id will work.

registerContextMenu(*) supports the registering of multiple IDs against
a context menu (the same MenuManager+viewer)

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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:What kinds of jobs do not cause hourglass?
Next Topic:Declaration for the UFacekit Project
Goto Forum:
  


Current Time: Thu Dec 26 10:09:21 GMT 2024

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

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

Back to the top