views:

63

answers:

1

I created an editor using the eclipse PDE.

Every time I double click on the same file it opens a new instance of my editor instead of just selecting the one that already opened (like in .java files). My Editor input implements IEditorInput. How can I change it?

+2  A: 

from the Eclipse JavaDoc:

IEditorInput is a light weight descriptor of editor input, like a file name but more abstract. It is not a model. It is a description of the model source for an IEditorPart.

Clients implementing this editor input interface should override Object.equals(Object) to answer true for two inputs that are the same. The IWorbenchPage.openEditor APIs are dependent on this to find an editor with the same input.

IWorkbenchPage.openEditor() checks all open editors on equality before it creates a new one.

Zappi