Binding editors to perspectives…
In 3.5M3, we introduced two new API methods, showEditor(IEditorReference) and hideEditor(IEditorReference), in IWorkbenchPage. This is an interim solution that was proposed as an attempt to resolve bug 11001. Paul has provided a great description about what those two methods do and what we’re trying to achieve here in his comment so I suggest you read that and familiarize yourself with the details.
Essentially, these two methods provide plug-in developers with the ability to (unsurprisingly) show and hide editors at will. This seems to be a somewhat common use case in the RCP world as there appears to be a tendency to define rigid perspectives that are only intended to perform certain actions and those actions alone. Clicking something brings an editor up but when they switch to another perspective this “irrelevant” editor is still there and people get upset and so on and so forth.
The notion of restricting editors to a perspective is not unheard of in the IDE space either as I hear people ask for this feature every once in a while on IRC. These users don’t seem to like having their Java editors show up in the ‘C/C++’ perspective. This sounds like a fair requirement I suppose (I wouldn’t know since I only do Java development). Some users also want this filtering functionality extended onto views by filtering out projects based on current perspective. Now this all sounds like something Mylyn (and/or Tasktop?) can help the user with although I’m not positive as to whether Mylyn can be made perspective-aware or not in this regard…but what do I know, I don’t even use Mylyn.
In any case, even if a plug-in was perspective-aware and was achieving the functionality offered by these two methods, I’d imagine that the developers are probably using internal classes and methods and/or are having a tough time getting the behaviour to work right. If you haven’t been having any problems, we would love to know how and you can let us know how by leaving a comment on the bug. For the rest of you, if the idea of showing and hiding editors, perspective-related or otherwise, are relevant to your project or plug-in, please, download 3.5M3, give the API a spin and try integrating it into your code and let us know how it’s working out for you. The response we have had thus far since Paul committed the code has been underwhelming to say the least and I am shocked to say that this request actually has 18 votes! Of course, that number was only applicable at the time of this posting because this post may or may not cause that number to fluctuate. ;)
November 16th, 2008 at 10:34 am
Emacs is still superior and has far more features.
November 17th, 2008 at 1:16 am
Anonymous: Hi Anon, well, don’t let us stop you from using Emacs. ;)