Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Generating Diagram out of Eclipse XTEXT by not using the Root-Element
Generating Diagram out of Eclipse XTEXT by not using the Root-Element [message #1105165] Mon, 09 September 2013 12:51
Günther Fiedler is currently offline Günther FiedlerFriend
Messages: 21
Registered: February 2013
Junior Member
Hello,

I´m trying to make some UML Editor's with GMF, by providing the MetaModel by using Xtext, so that I can have a textual / graphical Editor just like Yakindu.

Therefore I splitted the Diagram-grammars as follows (but still in one project and one file):

Modeling:

diagtype+=DiagramTypes*;

DiagramTypes:
(StructureDiagram | BehaviorDiagram);

StructureDiagram:
(ClassDiagram | ObjectDiagram | ComponentDiagram | ComponentInstanceDiagram);

BehaviorDiagram:
(StateMachineDiagram | ActivityDiagram);

Now I want to create the Editor for a StateMachine for example. After creating all the models (choosing the StateMachine rule as entrypoint) needed for GMF and trying to run the Diagram I get following errors:

org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
at christ.xtext.modelingframework.cmfdsl.cmfDsl.diagram.part.CmfDslDiagramEditorUtil.createDiagram(CmfDslDiagramEditorUtil.java:206)
at christ.xtext.modelingframework.cmfdsl.cmfDsl.diagram.part.CmfDslCreationWizard$2.run(CmfDslCreationWizard.java:142)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1028)
at christ.xtext.modelingframework.cmfdsl.cmfDsl.diagram.part.CmfDslCreationWizard.performFinish(CmfDslCreationWizard.java:159)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.actions.NewExampleAction.run(NewExampleAction.java:123)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.RuntimeException: The context 'Modeling' is not valid for type 'StateMachineDiagram'
Recommended contexts for type 'StateMachineDiagram':
Other valid contexts for type 'StateMachineDiagram': DiagramTypes, BehaviorDiagram, StateMachineDiagramThe context 'Modeling' is valid for types: Modeling, null

Semantic Object: StateMachineDiagram
at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:70)
at christ.xtext.modelingframework.cmfdsl.serializer.CmfDslSemanticSequencer.createSequence(CmfDslSemanticSequencer.java:1309)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:85)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:108)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:130)
at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:332)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1144)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:985)
at christ.xtext.modelingframework.cmfdsl.cmfDsl.diagram.part.CmfDslDiagramEditorUtil$1.doExecuteWithResult(CmfDslDiagramEditorUtil.java:190)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
... 47 more



[Updated on: Mon, 09 September 2013 14:24]

Report message to a moderator

Previous Topic:Using GMF in an Eclipse e4 RCP editor
Next Topic:Adding label to ScalableImageFigure
Goto Forum:
  


Current Time: Thu Apr 25 20:49:26 GMT 2024

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

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

Back to the top