Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to match editor inputs while accounting for different editors(Different editors should open the same resource in distinct editors)
How to match editor inputs while accounting for different editors [message #669576] Tue, 10 May 2011 15:22
Eclipse UserFriend
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.
Previous Topic:Perspectives in Eclipse
Next Topic:How to remove popup menus for a perspective
Goto Forum:
  


Current Time: Sun Aug 31 02:13:37 EDT 2025

Powered by FUDForum. Page generated in 0.03893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top