[Xtext] Processing Xtext Model [message #666875] |
Sat, 23 April 2011 14:40  |
Eclipse User |
|
|
|
Hi,
I am using Xtext with eclipse 3.5.
I get following info message in console when I run Workflow file (MWE2) in DSL project. How can I configure meta models using JavaBeans as default. Secondly in which file I have to write code to "process xtext model"?
3 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
80 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
80 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
Thanks
|
|
|
|
|
|
|
|
|
Re: [Xtext] Processing Xtext Model [message #666958 is a reply to message #666875] |
Mon, 25 April 2011 02:03   |
Eclipse User |
|
|
|
Hi!
Well, for example, within Eclipse' framework, using the API, I can get, let's say, a file from a project:
project.getFile("myfile").
But that returns an IFile instance. How can I convert it to a model so I can use that code:
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(URI.createURI("./mymodel.dmodel"), true);
EObject eobject = resource.getContents().get(0);
Or maybe, I should have a .dmodel file somewhere for that file?
Thanks,
Timo
|
|
|
|
|
|
|
Re: [Xtext] Processing Xtext Model [message #692570 is a reply to message #685381] |
Mon, 04 July 2011 14:56   |
Eclipse User |
|
|
|
Hi there!
I've managed to get an instance of the Root of my grammar, from a specific file, using this code:
URI uri = URI.createPlatformResourceURI( file.getFullPath( ).toString( ), true );
ResourceSet resSet = new ResourceSetImpl( );
Resource res = resSet.getResource( uri, true );
EObject obj = res.getContents( ).get( 0 );
System.out.println( obj);
However, the first time I use that code, the eclipse freezes like 2-3 seconds. Just first time in a session. Afterwards goes just fine, instantly.
Is there a reason behind it? Or it's the same reason the editor takes a while first time, to init and all that stuff?
Thanks,
Timo
|
|
|
Re: [Xtext] Processing Xtext Model [message #692609 is a reply to message #692570] |
Mon, 04 July 2011 16:38  |
Eclipse User |
|
|
|
Hi Timo,
it's the same reason. The activator takes a moment to start.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 04.07.11 20:56, forums-noreply@eclipse.org wrote:
> Hi there!
>
> I've managed to get an instance of the Root of my grammar, from a
> specific file, using this code:
>
>
> URI uri = URI.createPlatformResourceURI( file.getFullPath( ).toString(
> ), true );
> ResourceSet resSet = new ResourceSetImpl( );
> Resource res = resSet.getResource( uri, true );
> EObject obj = res.getContents( ).get( 0 );
> System.out.println( obj);
>
>
> However, the first time I use that code, the eclipse freezes like 2-3
> seconds. Just first time in a session. Afterwards goes just fine,
> instantly.
>
> Is there a reason behind it? Or it's the same reason the editor takes a
> while first time, to init and all that stuff?
>
> Thanks,
> Timo
|
|
|
Powered by
FUDForum. Page generated in 0.26398 seconds