Sirius-Xtext-Integration doesn't work for Transitions and Edge [message #1727648] |
Thu, 24 March 2016 17:51 |
Parsa Pourali Messages: 210 Registered: February 2014 |
Senior Member |
|
|
Hi All,
I've got a problem with sirius-xtext integration , specifically on OpenEmbeddedEditor. Note that, I've got the integration code from the one on the git.
We have a state machine in which there are states and transitions. Since it is a formal language, the transition labels (events/actions) can be complicated and have constraints and logic in it. Thus, we need to show a popup to the user to enter their transition label with the predefined Xtext grammar. We cannot open the Xtext embedded editor for the transitions (Edges). However, we can do it for other elements such as states and regions (Nodes).
I have tested it on the Sirius-Xtext-Integration example uploaded on git. Also in the example, the open xtext embedded editor does not work on the transitions.
The code for the embedded editor is:
public void execute(Collection<? extends EObject> context,
Map<String, Object> parameters) {
DiagramEditPart diagramEditPart = ((DiagramEditor) getActiveEditor())
.getDiagramEditPart();
for (EObject o : context) {
EditPart editPart = diagramEditPart.findEditPart(diagramEditPart, o);
if (editPart != null && (editPart instanceof IGraphicalEditPart)) {
openEmbeddedEditor((IGraphicalEditPart) editPart);
break;
}
}
}
The thing is that, it cannot find any editpart for the edges(e.g. Transitions). It can only find editparts for Nodes (e.g. States/Regions). Thus, the editpart becomes null and it does not open embedded editor.
It would be really appreciated if you could help me on this,
Thanks a lot,
Parsa
|
|
|
|
Powered by
FUDForum. Page generated in 0.02237 seconds