December 7, 2010

Bookmarking Files in Eclipse

Version Control

It can be last night’s dinner receipt, a business card, or an old Metallica concert ticket. It can be themed, fancy or simple.   Though not exactly rocket science, few will dispute it’s value.  It is the bookmark.  The concept of a bookmark is insanely simple but incredibly useful.  Have you ever tried to read your favorite Twilight book without one?  (Ok, I'll admit it - I've read the entire Twilight series.)

As the P4Eclipse QA Engineer, one of my responsibilities is to verify release notes that are checked into the depot.  Though not a difficult task, I found myself repeatedly expanding the same folders in the P4 Connections view to the get to the release notes I’m interested in.  Not being a fan of mundane tasks, I quickly wished that I could simply think “release notes” and have it appear in my Eclipse editor for viewing.  Realizing that will probably not be a feature of Eclipse in the near future, I settled for the next best thing - bookmarks.

Eclipse bookmarks provide an easy way to create short cuts to commonly used files from the depot.  All you need to do is:

  1. Go to the P4 Connections view and expand the folder where the files reside
  2. Right click “Import Project”
  3. Open the Navigator view
  4. Expand the imported project
  5. Select the file you want to bookmark
  6. Click on Edit | Add Bookmark...
  7. Enter a Bookmark name
  8. Click the “OK” button

The file is now bookmarked in Eclipse. To access the bookmark:

  1. Click on Window | Show View | Other...
  2. Expand “General” category and select “Bookmarks”
  3. Click the “OK” button
  4. Double click on the entry of interest

All your bookmarks will be listed in this view. Though not as sentimental as an old concert ticket, it’s definitely just as convenient.