Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Extension point has stopped working
Extension point has stopped working [message #840258] Mon, 09 April 2012 21:50 Go to next message
Arto Jarvinen is currently offline Arto JarvinenFriend
Messages: 32
Registered: May 2010
Location: Sweden
Member
I'm working on my own copy-paste and delete commands in a GMF editor. To add my own commands I've used the global-actions extensions for ...Presentation (delete, save) and ...Render (copy, paste, cut). This worked when I used Graphical Modeling Framework SDK 2.3.0 but when I migrated to 2.4.0 I got an additional "extension element" in my generated plugin.xml file in the diagram plugin:

<ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
<GlobalActionId actionId="save">
</GlobalActionId>
</ElementType>

With these additional lines my own DiagramGlobalActionHandler (which so far is very similar to the original class) providing my own delete command, the getCommand() method is only called to get the save command, not the delete command like it was before. If I comment out the lines above in the plugin.xml, it all works again. Also with the additional lines the delete command in the edit menu is always greyed out which it isn't without the lines.

I'm reading up on the Eclipse extension mechanism but haven't fully understood it yet. Maybe there is some mismatch between my class and the extension?

Any hints would be appreciated. Thanks! -A



[Updated on: Tue, 10 April 2012 07:30]

Report message to a moderator

Re: Extension point has stopped working [message #855485 is a reply to message #840258] Tue, 24 April 2012 21:43 Go to previous messageGo to next message
Arto Jarvinen is currently offline Arto JarvinenFriend
Messages: 32
Registered: May 2010
Location: Sweden
Member
I just ran the GeoShape example. Also there the Delete menu is disabled but the corresponding shortcut, the Delete key, works. Any insights to share anybody? -A

Re: Extension point has stopped working [message #855991 is a reply to message #855485] Wed, 25 April 2012 09:14 Go to previous message
Arto Jarvinen is currently offline Arto JarvinenFriend
Messages: 32
Registered: May 2010
Location: Sweden
Member
I've found out that everything works as I expect if I put both the "save" and the "delete" GlobalActionId inside the same ElementType declaration like in the plugin.xml excerpt below. In the generated version of the plugin.xml there are two separate ElementType declarations, one for "save" and one for "delete".

I'm not sure if the generated plugin.xml is incorrect or if the parser of the plugin.xml can't handle the generated code or if there is something totally different that I don't understand. In the declaration of "copy", "paste" and "cut" all commands are declare within the same ElementType declaration so this seems to be an ok way to do it.

Might this be a bug? -A

      <GlobalActionHandlerProvider
         class="ProcessModel.diagram.adaptations.MyDiagramGlobalActionHandlerProvider"
         id="ProcessmodelPresentation">
         <Priority name="Lowest"/>
         <ViewId id="ProcessModel.diagram.part.ProcessmodelDiagramEditorID">
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
               <GlobalActionId actionId="delete"/>
               <GlobalActionId actionId="save"/>
            </ElementType>
            <!--<ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
               <GlobalActionId actionId="save"/>
            </ElementType>-->
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
               <GlobalActionId actionId="save"/>
            </ElementType>
      </ViewId>
      </GlobalActionHandlerProvider>


Previous Topic:Exception when dragging shapes within compartment
Next Topic:generating xml-structured file beside the generated xmi file
Goto Forum:
  


Current Time: Sat Oct 31 14:23:26 GMT 2020

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

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

Back to the top