use of org.eclipse.sirius.ui.business.api.dialect.DialectEditor in project InformationSystem by ObeoNetwork.
the class DeleteInteractionHandler method closeEditor.
private void closeEditor(Session session, DRepresentation representation) {
IEditingSession editingSession = SessionUIManager.INSTANCE.getUISession(session);
if (editingSession != null) {
DialectEditor editor = editingSession.getEditor(representation);
if (editor != null) {
DialectUIManager.INSTANCE.closeEditor(editor, false);
editingSession.detachEditor(editor);
}
}
return;
}
use of org.eclipse.sirius.ui.business.api.dialect.DialectEditor in project InformationSystem by ObeoNetwork.
the class DeleteStateMachineHandler method closeEditor.
private void closeEditor(Session session, DRepresentation representation) {
IEditingSession editingSession = SessionUIManager.INSTANCE.getUISession(session);
if (editingSession != null) {
DialectEditor editor = editingSession.getEditor(representation);
if (editor != null) {
DialectUIManager.INSTANCE.closeEditor(editor, false);
editingSession.detachEditor(editor);
}
}
return;
}
use of org.eclipse.sirius.ui.business.api.dialect.DialectEditor 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