Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » The imports and package don't work in the generated diagram source code
The imports and package don't work in the generated diagram source code [message #182711] Fri, 11 April 2008 14:45 Go to next message
Eclipse UserFriend
Hi,

I'm a newbie with GMF and I have some difficulties to generate the
diagram editor source file of my .gmfgen file correctly.

I tryed some tutorial examples (mindmap, coffeeshop, ...) and didn't
have any problem to generate the editor source code but when I repeat
the same steps for my own model I always end with the same bad generated
editor source files.

Here is a simplified description of my ecore model:

Package: TargetNetwork
Class : TargetNetwork
Reference: Networks (Type: Target 0..*)
Attribute: Name (Type: EString)
Class : Target
Attribute: Name (Type: EString)


I followed the GMF Cheat Sheets steps to generate the:
- Domain Gen Model : .genmodel + src files + edit src files
- Graphical Def Model : .gmfgraph
- Tooling Def Model : .gmftool
- Mapping Model : .gmfmap
- Diagram Editor Gen Model .gmfgen

After theses steps, I didn't have any warning or any error in the
generated files. Note that the gmfgen file is also correct.

But when I generate the diagram editor source code, I got a lot of
warning and error related to import and package.

Example of error 1:
In my TargetCreateCommand class of the
TargetNetwork.diagram.edit.commands package, I have a conflict between
packages on the import command

import com.opalrt.emfproject.TargetNetwork;
// Error : Only a type can be imported.
// com.opalrt.emfproject.TargetNetwork resolves to a package.


Example of error 2:
In my TargetEditHelper class of the
com.opalrt.emfproject.TargetNetwork.diagram.edit.helpers package, I also
have a conflict between pacakge on the import command.


import com.opalrt.emfproject.TargetNetwork;
public class TargetEditHelper extends
TargetNetwork.diagram.edit.helpers.TargetNetworkBaseEditHelp er {
}


Normally, I looked in the mindmap example, the code should normally look
like:


public class TargetEditHelper extends TargetNetworkBaseEditHelper {
}

I have a lot of import and package problem like these one. I can
manually fix these problem but I'm wondering if I make a mistake
somewhere during generation of any part of the code / gmf file

Thanks.

Vincent
Re: The imports and package don't work in the generated diagram sourcecode [message #182727 is a reply to message #182711] Fri, 11 April 2008 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Hello Vincent L.,

Try setting another Package Name Prefix property in your .gmfgen model: http://wiki.eclipse.org/GMF_GenModel_Hints.
Looks like packages with names starting with Uppercased letters are not processed
correctly by GMF import organizer...

-----------------
Alex Shatalin
Re: The imports and package don't work in the generated diagram sourcecode [message #182927 is a reply to message #182727] Mon, 14 April 2008 10:12 Go to previous message
Eclipse UserFriend
Thank you,

It seems to work.

Vincent


Alex Shatalin wrote:
> Hello Vincent L.,
>
> Try setting another Package Name Prefix property in your .gmfgen model:
> http://wiki.eclipse.org/GMF_GenModel_Hints.
> Looks like packages with names starting with Uppercased letters are not
> processed correctly by GMF import organizer...
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Viewer of a graph
Next Topic:Making GMF editor toolbar splitable
Goto Forum:
  


Current Time: Sun Jun 08 04:08:43 EDT 2025

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

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

Back to the top