I registered a custom editor with eclipse extension point “org.eclipse.ui.editors” as follows.
<extension
point="org.eclipse.ui.editors">
<editor
class="com.xxx.designer.scxml.ui.ScxmlDiagramEditor"
id="com.xxx.designer.scxml.ui.ScxmlDiagramEditor"
extensions="scdiagram"
name="SCXML Editor">
</editor>
It works fine, this editor is associated with .scdiagram files. However, every time I click on one same .scdiagram file, it opens a new instance for me instead of highlighting the opened file. Any idea on this?
Thanks,
Jie
All you need to do is make your
IEditorInputreturn true for the same files. You could implement this by comparing the canonical names of your files. Don’t forget to also override the hashCode() method. What issues should be considered when overriding equals and hashCode in Java?See Lars Vogel’s excellent tutorial Eclipse Editor Plugin Tutorial for more details on using Editors.