Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Navigate Different Metamodels
Navigate Different Metamodels [message #1597267] Mon, 02 February 2015 07:04 Go to next message
Alain Perez is currently offline Alain PerezFriend
Messages: 3
Registered: January 2015
Junior Member
Hello everybody,

this is my first post, sorry for my english, isnt my mother language. I have been working with eclipse for a while and working with the examples and forum so far so good.

Now i have encountered a ploblem, and even if i have tried, i dont know what path to follow. I´m trying to open a new representation of a model, but from other domail class.

By the moment, i have a model representation with the domain class, the same meta model of the model. I want to create a navigation to a new diagram, of the same model, but with the domain model of other metamodel.

So far i have created the two diagrams without problem, but when i do the action that triggers the diagram change, i receive a dialog to enter diagrams name, but nothing happens.

Between the two metamodels already exists the needed connections.

Maybe is a easy question, but i have tried a lot and nothing seems to work.

Thanks in advance.
  • Attachment: esquema.bmp
    (Size: 209.55KB, Downloaded 111 times)
Re: Navigate Different Metamodels [message #1608195 is a reply to message #1597267] Mon, 09 February 2015 10:42 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
> Hello everybody,

Hi Alain,

I'm not sure to understand your needs properly. Can you provide us more
details (such as a sample project) about your scenario?

>
> this is my first post, sorry for my english, isnt my mother language. I have been working with eclipse for a while and working with the examples and forum so far so good.
>
> Now i have encountered a ploblem, and even if i have tried, i dont know what path to follow. I´m trying to open a new representation of a model, but from other domail class.
>
> By the moment, i have a model representation with the domain class, the same meta model of the model. I want to create a navigation to a new diagram, of the same model, but with the domain model of other metamodel.
>
> So far i have created the two diagrams without problem, but when i do the action that triggers the diagram change, i receive a dialog to enter diagrams name, but nothing happens.
>
> Between the two metamodels already exists the needed connections.
>
> Maybe is a easy question, but i have tried a lot and nothing seems to work.
>
> Thanks in advance.
>

Regards,

--
Florian - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Navigate Different Metamodels [message #1608540 is a reply to message #1608195] Mon, 09 February 2015 15:36 Go to previous message
Alain Perez is currently offline Alain PerezFriend
Messages: 3
Registered: January 2015
Junior Member
Im trying to open a model representation from an already model representaton. I have a diagram representation, and when double clicking a element i want to create a new representation programatically with that element as root. I use an external java action where i will create the new representation. I have read the documenteation and search in the forum.
This is the code i have so far:(inside de external java action. The clicked element is passed as "EObject objectInSession" )

//get session
URI myRepresentationsFileURI = URI.createPlatformResourceURI("/4_MPT_Models/representations.aird", true);
Session siriusSession = SessionManager.INSTANCE.getSession(myRepresentationsFileURI, new NullProgressMonitor());

//open representation
Collection<DRepresentation> myCollection = DialectManager.INSTANCE.getAllRepresentations(siriusSession);
for(DRepresentation a : myCollection){
if(a.getName().equals("myRepresentation")){
DialectUIManager.INSTANCE.openEditor(siriusSession, a, null);
}
}

When executing, i get the following error:
!ENTRY org.eclipse.gmf.runtime.diagram.ui 4 4 2015-02-09 16:35:12.711
!MESSAGE execute
!STACK 0
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:75)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:57)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.performRequest(GraphicalEditPart.java:1125)
at org.eclipse.gef.tools.SelectEditPartTracker.performOpen(SelectEditPartTracker.java:194)
at org.eclipse.gef.tools.SelectEditPartTracker.handleDoubleClick(SelectEditPartTracker.java:137)
at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx.handleDoubleClick(DragEditPartsTrackerEx.java:242)
at org.eclipse.gef.tools.AbstractTool.mouseDoubleClick(AbstractTool.java:1069)
at org.eclipse.gef.tools.SelectionTool.mouseDoubleClick(SelectionTool.java:527)
at org.eclipse.gef.EditDomain.mouseDoubleClick(EditDomain.java:231)
at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseDoubleClicked(DomainEventDispatcher.java:291)
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDoubleClick(LightweightSystem.java:518)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.NullPointerException
at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectUIServices.openEditor(DiagramDialectUIServices.java:182)
at org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.openEditor(DialectUIManagerImpl.java:102)
at es.ikerlan.actions.CreateDynamicInstanceAction.createSemanticResource(CreateDynamicInstanceAction.java:94)
at es.ikerlan.actions.CreateDynamicInstanceAction.execute(CreateDynamicInstanceAction.java:38)
at org.eclipse.sirius.business.internal.helper.task.operations.ExternalJavaActionTask.execute(ExternalJavaActionTask.java:123)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:103)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:114)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.execute(ExecuteToolOperationTask.java:88)
at org.eclipse.sirius.business.api.helper.task.TaskExecutor.operation(TaskExecutor.java:95)
at org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:65)
at org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper.doExecuteWithResult(GMFCommandWrapper.java:103)
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.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.sirius.diagram.ui.tools.internal.commands.WrappingCommandIgnoringAffectedFiles.execute(WrappingCommandIgnoringAffectedFiles.java:124)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
... 40 more

Previous Topic:How to create an editor/diagram editpart without opening it?
Next Topic:[SWTBotTest] How to retrieve/check exists of a context menu
Goto Forum:
  


Current Time: Tue Apr 23 16:54:41 GMT 2024

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

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

Back to the top