Search in sources :

Example 1 with DialectEditor

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;
}
Also used : DialectEditor(org.eclipse.sirius.ui.business.api.dialect.DialectEditor) IEditingSession(org.eclipse.sirius.ui.business.api.session.IEditingSession)

Example 2 with DialectEditor

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;
}
Also used : DialectEditor(org.eclipse.sirius.ui.business.api.dialect.DialectEditor) IEditingSession(org.eclipse.sirius.ui.business.api.session.IEditingSession)

Example 3 with DialectEditor

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);
            }
        }
    }
}
Also used : DialectEditor(org.eclipse.sirius.ui.business.api.dialect.DialectEditor) SubMonitor(org.eclipse.core.runtime.SubMonitor) IEditingSession(org.eclipse.sirius.ui.business.api.session.IEditingSession) UserSession(org.eclipse.sirius.ui.business.api.session.UserSession) Session(org.eclipse.sirius.business.api.session.Session) IEditingSession(org.eclipse.sirius.ui.business.api.session.IEditingSession)

Aggregations

DialectEditor (org.eclipse.sirius.ui.business.api.dialect.DialectEditor)3 IEditingSession (org.eclipse.sirius.ui.business.api.session.IEditingSession)3 SubMonitor (org.eclipse.core.runtime.SubMonitor)1 Session (org.eclipse.sirius.business.api.session.Session)1 UserSession (org.eclipse.sirius.ui.business.api.session.UserSession)1