GMF Tutorial: shortcuts between mindmaps don't seem to work... [message #17217] |
Mon, 14 August 2006 08:33  |
Eclipse User |
|
|
|
Hi all,
going through the tutorial (part 2) I tried to generate a shortcut from
one mindmap to another (as described in the second-last paragraph).
Since I had downloaded the example source code the two mentioned
properties in the .gmfgen file were already set to "mindmap", so that
feature should be available.
On one mindmap's background I click the "Generate Shortcut..." context
menu entry. I get a dialog with the current project at the top and I
would have assumed that I need to pick the documentRoot or the
root-topic of an other mindmap here. But no matter what node I select
from that tree the OK button remains grayed out and inactiv.
Any ideas on this? Known bug?
Michael
|
|
|
Re: GMF Tutorial: shortcuts between mindmaps don't seem to work... [message #20794 is a reply to message #17217] |
Wed, 16 August 2006 11:07  |
Eclipse User |
|
|
|
Hello Michael,
Thank you for reporting this problem! The reason of this problem is in inconsistency
between GMF generated code and EMF ItemProviders logic - should be fixed
in GMF generator! ;-) I've created the following request: https://bugs.eclipse.org/bugs/show_bug.cgi?id=154055
To my understanding, this problem show up then you are working with the .ecore
file initialized form XSD. To temporary work around it you can patch generated
XXXElementChooserDialog. OkButtonEnabler. selectionChanged() method in and
place the following code there:
/**
* @generated NOT
*/
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection() instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection.size() == 1) {
// [>>] IWrapperItemProvider could present in the selection
Object selectedElement = selection.getFirstElement();
if (selectedElement instanceof IWrapperItemProvider) {
selectedElement = ((IWrapperItemProvider) selectedElement).getValue();
}
// [<<] IWrapperItemProvider could present in the selection
if (selectedElement instanceof EObject) {
mySelectedModelElement = (EObject) selectedElement;
setOkButtonEnabled(ViewService.getInstance().provides(Node.c lass,new
EObjectAdapter(mySelectedModelElement),myView,null,ViewUtil. APPEND,true,MindmapDiagramEditorPlugin.DIAGRAM_PREFERENCES_H INT));
return;
}
}
}
mySelectedModelElement = null;
setOkButtonEnabled(false);
}
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.28722 seconds