开发者

two instances of the same editor

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 Edit开发者_运维百科or input implements IEditorInput. How can I change it?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜