Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Only a type can be imported.
Only a type can be imported. [message #990161] Tue, 11 December 2012 03:24 Go to next message
Eclipse UserFriend
Hi,

when I generate my diagram code I get some strange errors:

the import declaration I get errors:
import eastadl21.EAST_ADL.Infrastructure;

Only a type can be imported. eastadl21.EAST_ADL.Infrastructure resolves to a package

Infrastructure is a Package in my Ecore.

And in the code the elements can not be resolved:

myFeaturesToSynchronize.add(Infrastructure.Elements.ElementsPackage.eINSTANCE.getEAPackage_Element());

Infrastructure cannot be resolved



So, I have to manually resolve the problems... that's not practical for me. Do I really have to change the generation templates to get the imports working?! Or is there a workaround?

Thanks
Re: Only a type can be imported. [message #990190 is a reply to message #990161] Tue, 11 December 2012 05:39 Go to previous messageGo to next message
Eclipse UserFriend
Matthias,

You don't provide much information about your model, but please be sure
to respect Java naming conventions in your Ecore model. I.e., use Camel
case names and ensure that class names start with an upper case letter
and that package names start with a lower case letter. Be sure to avoid
ever having a package name and a class name be the same (which of course
can't ever happen if you follow the conventions).

On 11/12/2012 9:24 AM, Matthias N wrote:
> Hi,
>
> when I generate my diagram code I get some strange errors:
>
> the import declaration I get errors:
>
> import eastadl21.EAST_ADL.Infrastructure;
>
>
> Only a type can be imported. eastadl21.EAST_ADL.Infrastructure
> resolves to a package
>
> Infrastructure is a Package in my Ecore.
>
> And in the code the elements can not be resolved:
>
>
> myFeaturesToSynchronize.add(Infrastructure.Elements.ElementsPackage.eINSTANCE.getEAPackage_Element());
>
>
>
> Infrastructure cannot be resolved
>
>
>
> So, I have to manually resolve the problems... that's not practical
> for me. Do I really have to change the generation templates to get the
> imports working?! Or is there a workaround?
>
> Thanks
Re: Only a type can be imported. [message #990193 is a reply to message #990161] Tue, 11 December 2012 05:56 Go to previous message
Eclipse UserFriend
Hi Ed, thanks for your answer.

I solved it by setting the Package's names in my Ecore to lowercase.

Thanks
Previous Topic:Use existing model implementation
Next Topic:"Diagram is not present" message when opening 2nd Editor
Goto Forum:
  


Current Time: Tue Jul 01 03:44:06 EDT 2025

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

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

Back to the top