IGotoMarker and Editor Reopening [message #665158] |
Wed, 13 April 2011 13:39 |
Rhett Hudson Messages: 43 Registered: September 2010 |
Member |
|
|
I've implemented an IGotoMarker interface for my Graphiti editor. I have gotten it so that I can reference things in the editor from markers and the "Go To" action from the Problems View can select and show the user the PictogramElement that the marker references. But, whenever the "goto" action is executed, Eclipse opens another copy of the Graphiti editor.
The Plugin Development FAQ suggests, here, that custom implementations of IEditorInput should override Object.equals() to prevent this behavior. Graphiti uses a custom IEditorInput implementation, DiagramEditorInput, which provides an implementation of Object.equals(). At first examination, that implementation looks reasonable to me. Experimentally, even if I replace the implementation with code that just returns true, it doesn't stop the new editor from opening.
Has anyone else seen an issue like this?
|
|
|
Re: IGotoMarker and Editor Reopening [message #665178 is a reply to message #665158] |
Wed, 13 April 2011 14:36 |
Michael Wenz Messages: 1931 Registered: July 2009 Location: Walldorf, Germany |
Senior Member |
|
|
The Graphiti DiagramEditor registers a matching strategy for checking if an
editor for a given editor input is already open (see the extension of
org.eclipse.ui.editors in org.eclipse.graphiti.ui). At least when opening
the editor from the project explorer this check will be triggered, not sure
if this is also the case when opening from the problems view. Could you
check?
Nevertheless, there seems to be a bug in that implementation (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340939), that would explain
why it's not working as expected.
Michael
"Rhett Hudson" wrote in message news:io48l4$18l$1@news.eclipse.org...
I've implemented an IGotoMarker interface for my Graphiti editor. I have
gotten it so that I can reference things in the editor from markers and the
"Go To" action from the Problems View can select and show the user the
PictogramElement that the marker references. But, whenever the "goto" action
is executed, Eclipse opens another copy of the Graphiti editor.
The Plugin Development FAQ suggests,
http://wiki.eclipse.org/Eclipse_Plug-in_Development_FAQ#Why_ does_the_workbench_keep_opening_a_new_editor_every_time_I_op en_a_marker.3F,
that custom implementations of IEditorInput should override Object.equals()
to prevent this behavior. Graphiti uses a custom IEditorInput
implementation, DiagramEditorInput, which provides an implementation of
Object.equals(). At first examination, that implementation looks reasonable
to me. Experimentally, even if I replace the implementation with code that
just returns true, it doesn't stop the new editor from opening.
Has anyone else seen an issue like this?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03867 seconds