Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF generated diagram code do not support namespace.
GMF generated diagram code do not support namespace. [message #481840] Mon, 24 August 2009 14:09 Go to next message
Eclipse UserFriend
Originally posted by: diogenes.wang.gmail.com

Hi,
I am using the latest Eclipse Modeling Tool EPP (Eclipse Modeling Tools,
Build id: 20090619-0625). The problem I came across is:

When I generated the diagram editor code by right-clicking the .gmfgen
file, then 'Generate diagram code', I got the source code that could not
compile. The errors were caused by wrong reference to model elements. here
is an example:

import oaf.model.perception.Stakeholders;
...
Stakeholders.Stakeholder newElement =
Stakeholders.StakeholdersFactory.eINSTANCE
.createStakeholder();

both lines are wrong, since the referenced classes Stakeholder and
StakeholderFactory are all in package oaf.model.perception.Stakeholders (I
had the Base Package set as "oaf.model.perception" in my .genmodel, Prefix
as "Stakeholders".)

therefore the generated code should be something like this:

oaf.model.perception.Stakeholders.Stakeholder newElement =
oaf.model.perception.Stakeholders.StakeholdersFactory.eINSTA NCE
.createStakeholder();


I can get arround this problem by remove the Base Package setting,
therefore it generate the following code:

Stakeholders.Stakeholder newElement =
stakeholders.StakeholdersFactory.eINSTANCE
.createStakeholder();

which are correct since the package name Stakeholders has no base prefix.
But this is ugly and cannot fit into my projects. Otherwise every time
when I generate the code, I had to manually correct them. It's really
pain. So I really need to find the proper solution.

I suspect this is a bug in code generation, where the Base Package
information in .genmodel is not used to prefix the referenced package name.

Can anyone suggest a quick fix? or direct me to the right place, I really
need to get it solved ASAP.

Thanks,
Derek
Re: GMF generated diagram code do not support namespace. [message #481879 is a reply to message #481840] Mon, 24 August 2009 15:40 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Derek,

Try using small letter "s" in prefix "Stakeholders" instead of capital one
"S".

-----------------
Alex Shatalin
Re: GMF generated diagram code do not support namespace. [message #482179 is a reply to message #481879] Tue, 25 August 2009 15:20 Go to previous message
Eclipse UserFriend
Originally posted by: diogenes.wang.gmail.com

Alex Shatalin wrote:
> Hello Derek,
>
> Try using small letter "s" in prefix "Stakeholders" instead of capital
> one "S".
>
> -----------------
> Alex Shatalin
>
>
Thanks much. it fixed the problem. not sure why though.
Previous Topic:Custom source for validation
Next Topic:Cannot change the link line from straight line to another path.
Goto Forum:
  


Current Time: Wed Sep 18 20:38:46 GMT 2024

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

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

Back to the top