Search in sources :

Example 1 with ISiriusEditor

use of org.eclipse.sirius.ui.business.api.editor.ISiriusEditor in project InformationSystem by ObeoNetwork.

the class Activator method refreshDecorationsOnSession.

private void refreshDecorationsOnSession(final Session session, boolean forceRefresh) {
    if (!forceRefresh) {
        // Fail fast the decoration is disabled
        if (!ObjectWithRequirement.isDecoratorEnabled()) {
            return;
        }
    }
    IEditingSession uiSession = SessionUIManager.INSTANCE.getUISession(session);
    // We look for open diagram editors to refresh the diagrams
    if (uiSession != null) {
        Collection<ISiriusEditor> editors = uiSession.getSiriusEditors();
        for (ISiriusEditor siriusEditor : editors) {
            if (siriusEditor instanceof DDiagramEditor) {
                DDiagramEditor diagramEditor = (DDiagramEditor) siriusEditor;
                DRepresentation representation = diagramEditor.getRepresentation();
                if (representation instanceof DSemanticDiagram) {
                    DSemanticDiagram diagram = (DSemanticDiagram) representation;
                    refreshDecorationsOnDiagram(diagram, session);
                }
            }
        }
    }
}
Also used : DDiagramEditor(org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor) DSemanticDiagram(org.eclipse.sirius.diagram.DSemanticDiagram) IEditingSession(org.eclipse.sirius.ui.business.api.session.IEditingSession) ISiriusEditor(org.eclipse.sirius.ui.business.api.editor.ISiriusEditor) DRepresentation(org.eclipse.sirius.viewpoint.DRepresentation)

Aggregations

DSemanticDiagram (org.eclipse.sirius.diagram.DSemanticDiagram)1 DDiagramEditor (org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor)1 ISiriusEditor (org.eclipse.sirius.ui.business.api.editor.ISiriusEditor)1 IEditingSession (org.eclipse.sirius.ui.business.api.session.IEditingSession)1 DRepresentation (org.eclipse.sirius.viewpoint.DRepresentation)1