use of org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart in project Palladio-Editors-Sirius by PalladioSimulator.
the class SemanticElementsValidateAction method getFileToMark.
/*
* The marker should reference the main aird file, to be sure to load all the user session when clicking on the marker
* if the corresponding session is closed (referenced analysis cases or CDO for which the main aird is local file with
* information concerning the server).
* @was-generated NOT
*/
private static IFile getFileToMark(DiagramEditPart diagramEditPart, View view) {
Resource targetResource = view.eResource();
if (diagramEditPart instanceof IDDiagramEditPart) {
Option<DDiagram> ddiagram = ((IDDiagramEditPart) diagramEditPart).resolveDDiagram();
Session session = ddiagram.some() && ddiagram.get() instanceof DSemanticDiagram ? SessionManager.INSTANCE.getSession(((DSemanticDiagram) ddiagram.get()).getTarget()) : null;
if (session != null) {
targetResource = session.getSessionResource();
}
}
IFile target = targetResource != null ? WorkspaceSynchronizer.getFile(targetResource) : null;
return target;
}
Aggregations