| Xtext Graphical View [message #1036534] |
Mon, 08 April 2013 10:01  |
Daniel B Messages: 12 Registered: March 2013 |
Junior Member |
|
|
Hi there.
This is my problem: I'm working with xtext and I have to create a GRAPHICAL REPRESENTATION of the projects creating with my own language, I mean, once my dsl is creating I'm able to use it creating a "X" project and the idea is to be able to see the rappresentation of that project.
I've been searching for a good example, and for possible solutions, but is like a dead road. I've seen some posts about EUGENIA, GMF, SPRAY... but in any of those they explain what to do. There is also a video in xtext home page with the generic graphic view example, but once and again there is no the explanation about how to create the conexion beetwen my dsl and the results that I can obtain.
What do you suggest, what can I do, do you know a good example.....
Thanks a lot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Xtext Graphical View [message #1037315 is a reply to message #1037306] |
Tue, 09 April 2013 08:08   |
Claudio Heeg Messages: 57 Registered: April 2013 |
Member |
|
|
Hello,
sorry, I probably haven't expressed myself properly.
I was wondering where the file extension for files from which a diagram can be created is specified, "domainmodel" in this specific case.
It is likely an extension added to the context menu, applied to a specific file extension, as the menu entry "Initialize [...] diagram" (see picture) only appears in .domainmodel files. I believe if I can find out where that menu entry is registered I can figure out how to work with different extensions.
Edit:
Nevermind, I found it, it's in the popup menu extension of the diagram. Now to find out _why_ it's specified as *.domainmodel there.
Edit2:
Doesn't matter, just editing the nameFilter to *.dmodel does the trick.
Trivial solutions to annoying problems are nice.
It is, however, a little bit of a nuisance that I have to change this all the time when I generate the diagram code anew.
[Updated on: Tue, 09 April 2013 08:40] Report message to a moderator
|
|
|
| Re: Xtext Graphical View [message #1037930 is a reply to message #1037315] |
Wed, 10 April 2013 03:31   |
|
Hi
I jump in here if that's ok 
Dimitris, I tried to follow your steps but when I tried to generate the tool, graph, map thingies I got the following error message:
Method 'getContainmentReferences' not found (bundleresource://614.fwk1639539799/transformations/ECore2GMF.eol@189:38)
and when I run your zip folder i get the following errors when I try to make the mydsl_diagram file
"Premature end of file." and "java.lang.NullPointerException errors" so I end up with an empty diagram file I cant do much with.
So I don't seem to have much luck with making diagram files at the moment 
But I was wondering what I should look at in your code to see the interaction between XText and GMF? I am working at the moment in Graphiti and I have an XText grammar and a Graphiti diagram plugin and I am looking at merging them and even though your code is using GMF I thought it could be a good help.
Am I on the right track if I think the connection is in the plugin.xml from your org.xtext.example.mydsl.diagram package and the files in your org.xtext.example.mydsl.myDsl.provider package?
|
|
|
| Re: Xtext Graphical View [message #1037944 is a reply to message #1037930] |
Wed, 10 April 2013 03:51   |
Claudio Heeg Messages: 57 Registered: April 2013 |
Member |
|
|
Oh dear, I wrote up such a nice post and the forum ate it. Rude.
-
Anyway, I hope you don't mind if I answer to the best of my knowledge.
I'm by no means an expert on either Xtext or GMF-based tools, so take what I say with a grain of salt, but I gathered at least some knowledge during the last weeks.
As you probably know, Xtext relies on the EMF, i.e. creates an Ecore model for every grammar to then work with its nodes.
Eugenia (in this case, but other GMF tools too, as far as I know) also uses that model, but takes it in another direction to create a graphical view for it.
So I think the connection between Xtext and Eugenia is more or less only indirect via the Ecore model.
As for your error, I'll take a guess and say it's caused by an erroneous annotation.
|
|
|
| Re: Xtext Graphical View [message #1037978 is a reply to message #1037944] |
Wed, 10 April 2013 04:45   |
|
Feeling responsible for eating your post so... sorry.
(I blame that I am new to forums find it easier to continue in an existing thread then beginning a new one )
-
Have no problem with you answering my question, it explains a lot of the structure so I don't mind.
And now I know a bit more what to look for so thanks for the reply, and if I get more questions I will start a new thread
|
|
|
|
|
|
| Re: Xtext Graphical View [message #1041951 is a reply to message #1041684] |
Mon, 15 April 2013 16:18   |
Daniel B Messages: 12 Registered: March 2013 |
Junior Member |
|
|
Ok I've been having all the possible problems to reproduce this example. I just follow all the steps that Dimitris wrote but for some reason, even when diagram package is creating correctly, when I launch the new Eclipse Application I don't see the option for initialize the diagram file.
I've been looking for all the possible explanation but nothing until now.
[Updated on: Tue, 16 April 2013 08:11] Report message to a moderator
|
|
|
|
|
| Re: Xtext Graphical View [message #1053039 is a reply to message #1042421] |
Thu, 02 May 2013 03:37   |
serhat gezgin Messages: 136 Registered: January 2013 Location: Izmir |
Senior Member |
|
|
Hi all
I use this steps and my senchronization work perfect but when i generate my first
diagram from xtext program i always get error (error log attached as a error.txt file)
(But only first iteration i get this error on second or later iteration i dont get this error.)
and there is another problem is i can't create diagram file. I must create xtext program file and then i must genereate diagram file. So i want to ask u how can i create diagram file independently from xtext resource ?
first part of error ;
!ENTRY org.eclipse.osgi 2 0 2013-04-21 01:42:55.171
!MESSAGE The activator org.eclipse.gmf.examples.runtime.diagram.decorator.DecoratorPlugin for bundle org.eclipse.gmf.examples.runtime.diagram.decorator is invalid
!STACK 0
org.osgi.framework.BundleException: The activator org.eclipse.gmf.examples.runtime.diagram.decorator.DecoratorPlugin for bundle org.eclipse.gmf.examples.runtime.diagram.decorator is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:172)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:263)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:236)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.gmf.runtime.common.core.service.Service$ProviderDescriptor.getProvider(Service.java:158)
at org.eclipse.gmf.runtime.diagram.ui.internal.services.decorator.DecoratorService$ProviderDescriptor.provides(DecoratorService.java:72)
at org.eclipse.gmf.runtime.common.core.service.Service.safeProvides(Service.java:859)
at org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy.getUncachedProviders(ExecutionStrategy.java:254)
at org.eclipse.gmf.runtime.common.core.service.Service.getProviders(Service.java:537)
at org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy$4.execute(ExecutionStrategy.java:178)
at org.eclipse.gmf.runtime.common.core.service.Service.execute(Service.java:651)
at org.eclipse.gmf.runtime.diagram.ui.internal.services.decorator.DecoratorService.createDecorators(DecoratorService.java:121)
at org.eclipse.gmf.runtime.diagram.ui.editpolicies.DecorationEditPolicy.refresh(DecorationEditPolicy.java:184)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$3.run(GraphicalEditPart.java:858)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:851)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:253)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:223)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:212)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.addChild(GraphicalEditPart.java:1319)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:781)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.handleNotificationEvent(GraphicalEditPart.java:1464)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.notifyChanged(GraphicalEditPart.java:1438)
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:504)
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:399)
at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:73)
at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:214)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
at org.eclipse.emf.workspa
.
.
.
.
But only one i get this error on second or later iteration i dont get this error.
Anyone can help me to solve this eror ?
Regards
Attachment: error.txt
(Size: 82.37KB, Downloaded 14 times)
[Updated on: Thu, 02 May 2013 06:16] Report message to a moderator
|
|
|
|
|
| Re: Xtext Graphical View [message #1053736 is a reply to message #1053155] |
Tue, 07 May 2013 08:35  |
serhat gezgin Messages: 136 Registered: January 2013 Location: Izmir |
Senior Member |
|
|
Hi,
problem fixed, when i get update and recreate project. But now i have another problem
too I make new project (with synchronization steps) and then i write epsilon evl for
model validation it works perfect. But gmf error occured on diagram and xtext file
(separately) and evl quick fixed dont run on xtext file. Because of this i want error
and warnings dont occure on xtext file. How can i done this ? Anyone can help me ?
Just i want to write aperate error and warning for xtext file and gmf diagram
(sample scenario on attached picture.)
Regards
|
|
|
Powered by
FUDForum. Page generated in 0.02966 seconds