Sharing your CFEclipse / ColdFusion Builder Snippets across multiple installs

Thursday, December 24, 2009

As I’ve written previously, I rely heavily on snippets when working with CFEclipse. One problem I’ve always encountered, however, is keeping snippets synchronized across multiple Eclipse installations. Typically, this problem manifests when trying to keep them sync’d between my laptop, my work computer, and my PC at home. Recently, this problem has further been exacerbated by ColdFusion Builder. Not only do I want to keep my snippets sync’d between multiple installs of CFEclipse, but I want the same snippets applied to CFBuilder, as well.

Fortunately, this is a very easy to solve problem.

Dropbox

The first step is getting yourself a Dropbox account. Dropbox is a way to share files seamlessly across multiple computers. You’ll want to install dropbox on all your target machines.

Syncing

A) Creating the shared snippets directory in your dropbox

  1. Create a new directory in your dropbox folder, and call it “CFEclipse Snippets” or “CFSnippets” or whatever.
  2. Open CFEclipse (and CFBuilder if applicable).
  3. Go find your existing CFEclipse or CFBuilder extensions. In CFEclipse, you get there by going to window – preferences – CFEclipse. The Snippets install directory field will be there. Copy that path and go to it on your machine. It’ll contain a number of folders and a keycombos.properties file
  4. Cut all of those files and paste them into your new Snippets dropbox directory

B) Pointing CFEclipse to the  new snippets location

  1. If you haven’t done so yet, remove the snippets from the previous CFEclipse snippets location
  2. Open the Snip Tree View in CFEclipse and hit the “refresh” button. Your snip tree view should now be empty since there are no snippets there. This is an important sanity check… don’t skip it.
  3. Copy the path to your dropbox snippets directory into your clipboard
  4. Go to the CFEclipse window – preferences – cfeclipse preference page and paste the new snippets location into your dropbox snippets location
  5. Back in the Snip Tree View, hit the refresh button again. Your snippets should now show up.
  6. From now on, when you add or edit snippets, they’ll be modified in the dropbox location

Other Installs

For all your other installs – different versions of eclipse, different machines, whatever – you just follow the same steps as above from Section B. The bottom line is that if you want to sync snippets, you point all your installs to the same snippets location. Dropbox handles the magic of performing the actual synchronization

CFBuilder

Thus far, I’ve been talking about CFE only. Fortunately, CFBuilder uses the same model and code as CFE. So to get CFB working with the shared snippets, simply open CFBuilder, go to window – preferences – coldfusion – Snippets, and paste your shared snippets directory into that field. Hit Save, go back to CFB, and refresh your snip tree view

Voila… snippets synced!

 

*Note – On some of my Eclipse installs, I had to remove the snippets from the previous/original snippet location before it would recognize the new snippets location. YMMV.

-Marc

MXUnit Eclipse Plugin Updated

Saturday, December 19, 2009

What's new?

  • The pesky “resource is null” problem that some users have experienced when using project-level CFC paths and remote URLs should finally be resolved
  • The “Tag Context” view now has two new menu options: “Copy Exception” and “Copy Tag Context”. This is handy when you need to copy the exception message or the entire tag context, as a string, into a bug report, email, etc.
  • Clicking on an item in the Tag Context view will now trigger the “Compare” Dialog button, if the assertion is comparable (i.e. when an assertEquals() fails). Previously, you needed to click on the failing test to enable the button. That lameness has been resolved.
  • I was watching Terry Ryan’s  video on using the Apptacular ColdFusion Builder Extension to generate MXUnit tests, and I noticed that his MXUnit view in Eclipse had a gigantic “Test History” button. Turns out, I created this as a 32x32 image; Eclipse on Windows resizes this automatically to 16x16, but apparently that’s not true on the Mac. I was aghast at this hideous image, and so now it’s 16x16.

Here are some screenshots of the new stuff in the Tag Context panel:

“Copy” options

tagcontextview_1

“Compare” button enablement

tagcontextview_2

By the way: by default, the text compare dialog shows differences in black/gray. You can change this – as I’ve changed it to a reddish background in this shot – by going to Window – Preferences – General – Appearance – Colors and Fonts – Text Compare – Outgoing change color. Click the “Edit” button, and pick your color.

How do I get the update?

If you already have the plugin installed, then go through the normal update process. On Eclipse 3.5, that’s Help – Install New Software – Work With: MXUnit OR use Help – Check for Updates

If you don’t have the plugin installed, then use Help – Install New Software – Add  and use http://mxunit.org/update as the URL

Enjoy.

--Marc