Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Specialize an Element Type in the plugin.xml
icon9.gif  Specialize an Element Type in the plugin.xml [message #493443] Mon, 26 October 2009 09:40 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hello,

In the diagram plugin I have a Element Type that I want to specify in another plugin. The ElementType is the following:

<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
  <metamodel nsURI="http://stp.eclipse.org/bpmn">
     <metamodelType
         id="es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001"
         name="Sequence Flow"
         kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
         eclass="SequenceEdge"
         edithelper="es.cv.gvcase.mdt.bpmn.diagram.edit.helpers.SequenceEdgeEditHelper">
      <param name="semanticHint" value="3001"/>
    </metamodelType>
  </metamodel>
</extension>


If I copy & paste this ElementType in my other plugin (modifying the editHelper class to use the new one), Eclipse shows me an Error in the ErrorLog: "Error initializing element type "es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001": element type with same ID already exists. It will be ignored."

How can I specify an existent ElementType?

Thanks in advance.
Marc Gil
Re: Specialize an Element Type in the plugin.xml [message #493445 is a reply to message #493443] Mon, 26 October 2009 09:56 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I think that you need to use a specialization type.
You can take a look at the point 10 of http://wiki.eclipse.org/index.php/GMF_Tips#Sharing_single_Ed itingDomain_instance_across_several_diagrams


Regards,

Aurelien Pupier


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Specialize an Element Type in the plugin.xml [message #493447 is a reply to message #493445] Mon, 26 October 2009 10:37 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Thanks Aurelien,

I try to do this, but it doesn't work. I replace the following code:
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
  ...
  <metamodel nsURI="http://stp.eclipse.org/bpmn">
     <metamodelType
         id="es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001"
         name="Sequence Flow"
         kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
         eclass="SequenceEdge"
         edithelper="es.cv.gvcase.mdt.bpmn.diagram.edit.helpers.SequenceEdgeEditHelper">
      <param name="semanticHint" value="3001"/>
    </metamodelType>
  </metamodel>
  ...
</extension>


with the following one:
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
  ...
  <metamodel nsURI="http://stp.eclipse.org/bpmn">
    <specializationType
      id="es.cv.gvcase.gva.configuration.bpmn.diagram.SequenceEdge_3001"
      name="Sequence Flow"
      kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
      edithelperadvice="es.cv.gvcase.gvm.configuration.bpmn.diagram.edit.helpers.SequenceEdgeEditHelper">
      <specializes id="es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001"/>
      <param name="semanticHint" value="3001"/>
    </specializationType>
  </metamodel>
  ...
</extension>


The editHelperAdvice extends the old SequenceEdgeEditHelper and inherit from IEditHelperAdvice. It redefines the getConfigureCommand() method from AbstractEditHelper class.

They continue using the "old" editHelper. The elementType is not redefined... Sad Of course, the second plugin has the main diagram plugin in the dependencies list...

Marc

[Updated on: Mon, 26 October 2009 10:45]

Report message to a moderator

icon7.gif  Re: Specialize an Element Type in the plugin.xml [message #493512 is a reply to message #493447] Mon, 26 October 2009 15:16 Go to previous message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
I get it!!!

<extension
            point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
         <metamodel
               nsURI="http://stp.eclipse.org/bpmn">
            <adviceBinding
                  class="es.cv.gvcase.gvm.configuration.bpmn.diagram.edit.helpers.SequenceEdgeEditHelper"
                  id="es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001"
                  inheritance="all"
                  typeId="es.cv.gvcase.mdt.bpmn.diagram.SequenceEdge_3001">
            </adviceBinding>
         </metamodel>
      </extension>


With an Advice Binding...

Thanks.
Marc
Previous Topic:unrecognized double-click event clicking on my own pictures
Next Topic:Eclipse to netbeans
Goto Forum:
  


Current Time: Thu Apr 25 18:49:43 GMT 2024

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

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

Back to the top