Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius-Xtext-Integration doesn't work for Transitions and Edge
Sirius-Xtext-Integration doesn't work for Transitions and Edge [message #1727648] Thu, 24 March 2016 17:51 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
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
Re: Sirius-Xtext-Integration doesn't work for Transitions and Edge [message #1727757 is a reply to message #1727648] Sat, 26 March 2016 22:38 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
I found a solution myself, I just passed the diagramEditPart and the Transition object manually instead of using findEditPart !
Previous Topic:Professional support for Sirius
Next Topic:Sirius editor with Kieler/KLay layouter resizes nodes
Goto Forum:
  


Current Time: Thu Mar 28 21:11:42 GMT 2024

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

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

Back to the top