Skip to main content



      Home
Home » Modeling » EMF » EMF object & propertyTester
EMF object & propertyTester [message #482356] Wed, 26 August 2009 07:04 Go to next message
Eclipse UserFriend
Hello,

In an extension definition of a popup menu contribution in the MANIFEST file (visibleWhen element), I'd like to test whether the object is a mymodel EMF instance ( myfile.mymodel file ).

Do I have to write the testProperty class or does EMF generates something that could help me ?
Is there a classical way to perform this task ?

Thanks a lot,

Cyril.
Re: EMF object & propertyTester [message #482370 is a reply to message #482356] Wed, 26 August 2009 07:24 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------070500070503090203060407
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Cyril,

You should be able to register the popup for specific types of objects,
e.g.,

<objectContribution
id="org.eclipse.emf.ecore.editor.CreateDynamicInstance"
* objectClass="org.eclipse.emf.ecore.EClass">*
<action
id="org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction "
label="%_UI_CreateDynamicInstance_menu_item"
menubarPath="additions"

class="org.eclipse.emf.ecore.action.CreateDynamicInstanceAction "
enablesFor="1"/>
</objectContribution>

Cyril Giraudon wrote:
> Hello,
>
> In an extension definition of a popup menu contribution in the
> MANIFEST file (visibleWhen element), I'd like to test whether the
> object is a mymodel EMF instance ( myfile.mymodel file ).
>
> Do I have to write the testProperty class or does EMF generates
> something that could help me ?
> Is there a classical way to perform this task ?
>
> Thanks a lot,
>
> Cyril.
>

--------------070500070503090203060407
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Cyril,<br>
<br>
You should be able to register the popup for specific types of objects,
e.g.,<br>
<br>
      &lt;objectContribution<br>
            id="org.eclipse.emf.ecore.editor.CreateDynamicInstance"<br >
           <b> objectClass="org.eclipse.emf.ecore.EClass"&gt;</b><br >
         &lt;action<br>
              
id="org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction "<br>
               label="%_UI_CreateDynamicInstance_menu_item"<br>
               menubarPath="additions"<br>
              
class="org.eclipse.emf.ecore.action.CreateDynamicInstanceAction "<br>
               enablesFor="1"/&gt;<br>
      &lt;/objectContribution&gt;<br>
<br>
Cyril Giraudon wrote:
<blockquote cite="mid:h734re$7v2$1@build.eclipse.org" type="cite">Hello,
<br>
<br>
In an extension definition of a popup menu contribution in the MANIFEST
file (visibleWhen element), I'd like to test whether the object is a
mymodel EMF instance ( myfile.mymodel file ).
<br>
<br>
Do I have to write the testProperty class or does EMF generates
something that could help me ?
<br>
Is there a classical way to perform this task ?
<br>
<br>
Thanks a lot,
<br>
<br>
Cyril.
<br>
<br>
</blockquote>
</body>
</html>

--------------070500070503090203060407--
Re: EMF object & propertyTester [message #482462 is a reply to message #482370] Wed, 26 August 2009 12:13 Go to previous message
Eclipse UserFriend
thanks Ed, but I use the command API.

I've finally succeeded with :

<visibleWhen
checkEnabled="false">
<with
variable="selection">
<iterate
ifEmpty="false"
operator="or">
<and>
<instanceof
value="org.eclipse.core.resources.IResource">
</instanceof>
<test
property="org.eclipse.core.resources.extension"
value="mymodel">
</test>
</and>
</iterate>
</with>
</visibleWhen>

Cyril.
Previous Topic:the right ResourceFactory for the right resource
Next Topic:[CDO] CDOID vs. EMF ID attribute
Goto Forum:
  


Current Time: Tue Nov 04 01:30:12 EST 2025

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

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

Back to the top