use of org.eclipse.sirius.ui.business.api.session.IEditingSession in project InformationSystem by ObeoNetwork.
the class BusinessProjectImporter method saveAndCloseEditorsOnTargetProject.
private void saveAndCloseEditorsOnTargetProject(IProgressMonitor parentMonitor) throws CoreException {
SubMonitor monitor = SubMonitor.convert(parentMonitor, 3);
if (shouldSaveAndCloseEditorsOnTargetProject()) {
// Save session if needed
Session session = ImporterUtil.getSession(getTargetProject());
if (session.getStatus().equals(SessionStatus.DIRTY)) {
session.save(monitor.newChild(1));
}
// Close diagrams
IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
if (uiSession != null) {
Collection<DialectEditor> editors = uiSession.getEditors();
if (!editors.isEmpty()) {
uiSession.closeEditors(true, editors);
}
}
}
}
Aggregations