gmf as rcp : the common navigator introduces bugs [message #630218] |
Fri, 01 October 2010 08:18 |
emil salageanu Messages: 94 Registered: June 2010 Location: Nice, France |
Member |
|
|
Hello all,
I have been working for several days on transforming my plugin-based gmf application in an RCP stand-alone application.
I post this message hoping that someone already implemented a gmf rcp application with user workspace.
Here's my problem - one of them :
I first added a workbench starter window in order to let the user choose the workspace. After a little debugging and workaround I managed to make it work.
I added a project explorer for the workbench. I generated the navigator code from gmfgen file, then I used the information in this blog (http://www.cpuidle.de/blog/?p=48) to make it work.
As the concrete implementation of the navigator I tried org.eclipse.ui.navigator.CommonNavigator and org.eclipse.ui.navigator.ProjectExplorer. I have the same bugs in both cases:
- (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.
- 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.
[Updated on: Fri, 01 October 2010 08:20] Report message to a moderator
|
|
|
Re: gmf as rcp : the common navigator introduces bugs [message #630606 is a reply to message #630218] |
Mon, 04 October 2010 11:22 |
emil salageanu Messages: 94 Registered: June 2010 Location: Nice, France |
Member |
|
|
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.02742 seconds