Thursday, November 4, 2010
Perspective Switcher Plugin for Eclipse / Flash Builder
Update: current version is 0.1.1 - read below
In my projects, I tend to work with more than one language inside Eclipse. Sometimes it's up to four but typically at least two (e.g. Java and Flex). One thing that always annoyed me inside Eclipse is, that it does not automatically switches perspectives based on the current language (or IDE plugin). So I always end up in the wrong perspective, seeking for a certain view or getting nuts because some key bindings overlap and do something different in one perspective than in another one. Know the pain? Here's the meds :)
I'm happy to introduce Perspective Switcher, a simple plugin for Eclipse (3.4 and above) which automatically switches perspectives for you based on the rules you define. It is not specific to Flash Builder at all and should work fine with *any* perspectives inside Eclipse.
Also, as of version 0.1.1, the Plugin will now automatically switch back from a Debug perspective to the previous non-Debug perspective as soon as the Debug session is terminated (yeah!). This feature is enabled by default but can be explicitly switched on and off in the Preferences page (but you don't really want to switch it off I promise) - again, this feature should work with *any* Debuggers inside an Eclipse distro as long they are built around Eclipse's DebugPlugin API.
Essentially, in the preferences page the plugin lists all active perspectives in your distribution and allows to specify which file extensions should be associated to them:
There's no validation on the extensions and you can also assign one extension to more than one perspective but the plugin will only pick the first perspective it finds.
Also, when testing I found that changing perspectives when in a Debug perspective is probably not a good idea, so all Debug perspectives are not shown in the list.
The plugin only switches perspectives when an Editor (e.g. JDT's Java Editor or Flash Builders MXML Editor) gets activated, either by opening a file or by switching from one open editor to another (by whatever means).
To install, simply unzip the ZIP file and copy the JAR into your distributions
/plugins /dropins folder. Then restart Eclipse / FB with the -clean switch. You should then see the "Perspective Switcher" entry on the Preferences dialog.
Current version is 0.1.1 - Download the ZIP file here.
Really nice and helpful plugin! this is going to save me lots of clicks at the end of the day!
glad you like it :)
Hi, I tried this out but it's still not switching back to the Java perspective after debugging has terminated. Any ideas? I'm running Eclipse 3.6 if that matters.
Hi. Does the plugin preferences page show up when you go to the Eclipse / FB Preferences?
Could you open source the plug-in? Maybe creating a Google Code, Sourceforge, yourfavoriteprojecthostinghere? Thanks
This is EXACTLY what I was looking for! Many thanks.
The download link doesn't work. And I'd reeeeallly like this plugin :)
Thanks for creating and sharing this plugin. It works as advertised for me, and is just what I was looking for. Kudos!
I was really surprised to see that, for a complicated IDE with separate perspectives for Java/C++, it is not smart enough to tell what .java and .cpp means! Working on a Java + C++ project, I constantly had to switch back and forth just to get the "Build" button back for C++. Thanks to you I no longer have to, it's working flawlessly. Thank you very much!!! :)
PS: Perhaps it should have ".c .cpp .h" set as default for the C/C++ perspective?
This doesn't work for the Latest Eclipse IDE: Kepler.
Thanks for the effort though!
nice extension. It works for Kepler for me. But you have to setup some associations first. Goto Preferences / Perspective Switcher and add your file extensions to the according perspectives.