Search in sources :

Example 1 with FileEditorInputProxy

use of org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileEditorInputProxy in project statecharts by Yakindu.

the class DiagramPartitioningDocumentProvider method setDocumentContent.

@Override
protected boolean setDocumentContent(IDocument document, IEditorInput editorInput) throws CoreException {
    if (editorInput instanceof IDiagramEditorInput) {
        Diagram diagram = ((IDiagramEditorInput) editorInput).getDiagram();
        document.setContent(diagram);
        return true;
    } else if (editorInput instanceof FileEditorInputProxy) {
        setDocumentContentFromStorage(document, ((FileEditorInputProxy) editorInput).getFile());
        return true;
    }
    return super.setDocumentContent(document, editorInput);
}
Also used : IDiagramEditorInput(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditorInput) Diagram(org.eclipse.gmf.runtime.notation.Diagram) FileEditorInputProxy(org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileEditorInputProxy)

Aggregations

IDiagramEditorInput (org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditorInput)1 FileEditorInputProxy (org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileEditorInputProxy)1 Diagram (org.eclipse.gmf.runtime.notation.Diagram)1