Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Object Action Contributions
Object Action Contributions [message #421856] Thu, 14 August 2008 18:40 Go to next message
Mike Gering is currently offline Mike GeringFriend
Messages: 41
Registered: July 2009
Member
I would like to make a popup menu object contribution that appears when
the selected object in my model is of a certain type. Is there a way to
do this with the object contribution extension point and filters? Using
the instanceof test won't work because the selected object may be
wrapped in a WrapperItemProvider, and I don't see a way to filter this
case further by testing, for example, the result of
WrapperItemProvider.getEditableValue().

Thanks,
Mike Gering
Re: Object Action Contributions [message #421858 is a reply to message #421856] Thu, 14 August 2008 20:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030706070707070503080903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Mike,

Comments below.

Mike Gering wrote:
> I would like to make a popup menu object contribution that appears
> when the selected object in my model is of a certain type. Is there a
> way to do this with the object contribution extension point and
> filters? Using the instanceof test won't work because the selected
> object may be wrapped in a WrapperItemProvider, and I don't see a way
> to filter this case further by testing, for example, the result of
> WrapperItemProvider.getEditableValue().
That's why in the latest editors we generate this so that an unwrapped
selection is made available for registered actions:

getSite().registerContextMenu(contextMenu, new
UnwrappingSelectionProvider(viewer));

>
> Thanks,
> Mike Gering

--------------030706070707070503080903
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mike,<br>
<br>
Comments below.<br>
<br>
Mike Gering wrote:
<blockquote cite="mid:g81u7o$s26$1@build.eclipse.org" type="cite">I
would like to make a popup menu object contribution that appears when
the selected object in my model is of a certain type. Is there a way to
do this with the object contribution extension point and filters? Using
the instanceof test won't work because the selected object may be
wrapped in a WrapperItemProvider, and I don't see a way to filter this
case further by testing, for example, the result of
WrapperItemProvider.getEditableValue().
<br>
</blockquote>
That's why in the latest editors we generate this so that an unwrapped
selection is made available for registered actions:<br>
<br>
<small>&nbsp;&nbsp;&nbsp; getSite().registerContextMenu(contextMenu, new
UnwrappingSelectionProvider(viewer));</small><br>
<br>
<blockquote cite="mid:g81u7o$s26$1@build.eclipse.org" type="cite"><br>
Thanks,
<br>
Mike Gering
<br>
</blockquote>
</body>
</html>

--------------030706070707070503080903--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Set<K> vs Map
Next Topic:Teneo ENumUserType error during datastore initialization
Goto Forum:
  


Current Time: Fri Apr 26 07:02:51 GMT 2024

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

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

Back to the top