|
Re: gmf as rcp : the common navigator introduces bugs [message #630606 is a reply to message #630218] |
Mon, 04 October 2010 07:22  |
Eclipse User |
|
|
|
Quote: |
(Main issue): when I create a diagram inside a project in the workspace the diagram and xml files are initiated correctly. But when I modify the diagram, the xml file is no longer modified. Which leads to an inconsistent state between the 2 files.
|
This happens because, when double clicking on a diagram file in the common navigator view, for some reason, the input given to the xxxDiagramEditor is of type FileEditorInput instead of URIEditorInput.
This code, added in the XXXDiagramDocumentEditor class solves the problem:
/**
* when opening a diagram from the common navigator view the given input has wron type. need to convert
*/
public void doSetInput(IEditorInput input, boolean releaseEditorContents) throws CoreException {
if (input instanceof FileEditorInput)
{
FileEditorInput fei = (FileEditorInput)input;
fei.getURI();
URI uri = URI.createURI(fei.getURI().toString());
input = new URIEditorInput(uri);
}
super.doSetInput (input, releaseEditorContents);
}
Quote: |
- at workbench startup the navigator is empty, it refreshes itself when the user click on it.
- the same diagram will be opened several times if double-clicking on it several times in the navigator.
|
See this thread for solution:
http://www.eclipse.org/forums/index.php?t=msg&th=197671& amp;start=0&S=ebae5d393753690ada5daa9c39726d98
|
|
|
Powered by
FUDForum. Page generated in 0.05352 seconds