 |
Mylar - a very useful Eclipse plugin
Posted by kirillcool on November 06, 2005 at 01:29 AM | Comments (4)
The Mylar plugin for Eclipse (available for versions 3.1 and 3.2M3 only) is, without doubt, one of the most innovative ways to change out interaction with IDEs.
Let's see a typical example of our daily work on Java project. You get a task, which can be an enhancement, new feature or bug fix. Typically, you have your project as a tree on the left-hand side, along with the list of all methods / fields (either as sub-branches of the project tree or as a separate tree). When you need to view or change source code, you either locate the corresponding entry in the project tree, or use one of the many shortcuts (such as Ctrl+Shift+T in Eclipse) to locate that class. Typically, you will need to access a number of classes, with a couple of methods in each one of them. Now, consider what happens in an existing project.
You have hundreds (if not thousands) of classes in tens of packages, each class having quite a few functions (depending on the previous team members, it can get to hundreds). The classes that you need to change for a particular bug fix are most likely under different packages. When you need to go back and forth between these classes, you waste valuable time (and energy) to do so. Wouldn't it be nice to have a context view of your workspace. This view would contain only relevant branches of the project tree, the classes you are working on and the methods that you are changing. Ideally, the IDE itself would track the changes you are making to the codebase, continually updating the context view. Mylar plugin for Eclipse does exactly that.
Here are few screenshots that show the differences (before and after applying Mylar):
Outline of a single class - before Mylar (click to view full-size)

Outline of a single class - after Mylar (click to view full-size)

Outline of class tree - before Mylar (click to view full-size)

Outline of class tree - after Mylar (click to view full-size)

Few things should be noted. First of all, Mylar is very much work in progress, so there are quite a few quirks and exceptions. In addition, if your task spans more than 5-6 classes, and you work on more than one function in each class, the UI gets a little bit overstuffed (however, you can remove the context entries manually):

Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Hi Kirill,
Pretty nice that you share this plugin's funcionality with us :-) ...Thought I'd share the way I work in Eclipse (if you don't mind) :-)
I usually work like this: If I need a class, just like you mentioned, I use Ctrl+Shift+T. Then, to go to the method/field that I want to, I open the Outline View (Alt+Shift+Q, O) and type the name of the method I want to go. F12 brings me back to the editor for me to do my changes. And after I've changed a bunch of classes in different packages, I go Ctrl+PgUp/Down to switch between editors. (Or Ctrl+Shift+T again)
Also, instead of leaving the trees open, I leave them on quicklaunch (?) and when I need I type the hotkey, open the resource and Esc. :-)
This helps me to keep the resources handy and my hands on the keyboard, although it only gives good productivity when you already know which classes you want to change (as is probably your case with substance)
What do you think? :-)
Posted by: duinewbah on November 06, 2005 at 04:07 AM
-
Quite handy, although it sounds a bit like the Microsoft-circa-2000 style of hiding menu items that you don't use very often, and might get annoying.
I'll also offer my work pattern :-)
I don't use Eclipse very often by my way of dealing with oft-used items in Idea is to find classes with ctrl+N and when I want to work on something i've touched a lot in the session, I use ctrl+E to bring up a list.
The project hierarchy is usually closed to save space.
I also use bookmarks to keep track (with comments) of places I'm interested in, and in Idea 5 you have a favourites list.
I nice plugin for Idea would one that puts oft-used items in a Favourites list automatically.
Posted by: goron on November 06, 2005 at 04:32 AM
-
There are few things about Mylar Kiril didn't mention.
First of all in Mylar it all starts from the task and for each task Mylar keep track of the context, you can deactivate task and later return back to it and the filters will be the same, so you'll only see interested classes on all views. Not to mention that class lists in Ctrl-Shift-T view and in drop-down for Ctrl-Space code completion would have most interesting classes right on top.
By the way, these filters also include code folding, so it won't be views only, your editor will have code you've working on right before your eyes.
Interesting part is that tasks can come from the Bugzila query, so you wold basically start your work from the bug report. There are basic support for other issue tracking systems as well.
And least but not last Mylar feature I'd like to mention here is the Active search view. Basically it predicts the interested search quries and run them in advance in the background, so you have all the results already when you think about them. That includes references to the given class (including manifests and some xml descriptors), test for that class, and few other things.
Actually there are few Flash demos available at http://eclipse.org/mylar/doc.php
Posted by: euxx on November 06, 2005 at 05:27 AM
-
Now that looks very interesting and worth a look :-)
Posted by: duinewbah on November 07, 2005 at 08:42 AM
|