How to match editor inputs while accounting for different editors [message #669576] |
Tue, 10 May 2011 15:22 |
Eclipse User |
|
|
|
I have a resource that can be opened with either of two editors. One editor is the default, and both editors are available as explicit "Open with" actions.
I have implemented an editor matching strategy such that if an editor is already open on the resource being opened, the framework will shift focus to it rather than open another instance.
However, if Editor A is open on Resource X, and then the user requests to open Resource X with Editor B, nothing happens. The IEditorMatchingStrategy can only deal with EditorInput instances. In this case, it determines that the input being presented is backed by the same resource that it is already editing, so match() returns true, and the resource continues to be edited by Editor A, even though the user requested Editor B.
I'd like to be able to return false from match() if the editor that the user requested to be opened is different from the one for which IEditorMatchingStrategy is implemented. But I don't see how I can determine from within the IEditorMatchingStrategy implementation which editor the user requested to be used to open the resource.
|
|
|
Powered by
FUDForum. Page generated in 0.03893 seconds