| Summary: | Let accept DiagramEditor a URIEditorInput | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Graphiti | Reporter: | Klaus S. <christian.stein2> | ||||
| Component: | Core | Assignee: | Project Inbox <graphiti-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | michael.wenz, tim.kaiser | ||||
| Version: | 0.7.0 | Flags: | michael.wenz:
indigo+
|
||||
| Target Milestone: | 0.8.0 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | Indigo M6 theme_round_offs | ||||||
| Attachments: |
|
||||||
Created attachment 188150 [details]
Modified DiagramEditorFactory class which creates an DiagramEditorInput from URIEditorInput
I have taken over the suggested patch and added the corresponding checks in the DiagramEditorMatchingStrategy; besides I added an context menu action that enables opening an arbitrary Graphiti Diagram file into to examples common plugin (context menu of a Graphiti sample project). Part of Graphiti Indigo 0.8.0 |
Build Identifier: Currently the DiagramEditor accepts as input "DiagramEditorInput" and "IFileEditorInput". It might be useful to enable the DiagramEditor accepting an URIEditorInput which enables open diagram files which are located outside the current workspace. "IFileEditorInput" cannot handle files which are not inside the current workspace (unless the file is linked into the workspace). Suggestion: adding the following easy snipped into DiagramEditorFactory.createEditorInput(IEditorInput otherInput) which creates the DiagramEditorInput from a URIEditorInput if (otherInput instanceof URIEditorInput){ final URIEditorInput fileInput = (URIEditorInput) otherInput; final TransactionalEditingDomain domain = createResourceSetAndEditingDomain(); URI diagramFileUri = fileInput.getURI(); if (diagramFileUri != null) { // the file has to contain one base node which has to be a diagram diagramFileUri = GraphitiUiInternal.getEmfService().mapDiagramFileUriToDiagramUri(diagramFileUri); return new DiagramEditorInput(diagramFileUri, domain, null, true); } } Reproducible: Always