Wednesday, May 12, 2010

Setting persistence file for Eclipse Multi-Clipboard plugin

I have been using Bastian Bergerhoff's excellent Multi-Clipboard Eclipse plugin for a few years now. It is brilliant: you get a potentially unlimited number of clipboard buffers that you can copy/cut to or paste from. There is a handy view supplied to see the contents of all the buffers. There are customisable keyboard shortcuts for getting items into/out of the buffers: you can set your own shortcuts for copying/pasting to/from buffers 1 through 10.

You can even tell the plugin to persist the buffers to a file such that the buffer contents survive across Eclipse restarts. Do this by specifying a writable directory in the plugin's preferences: Window > Preferences > Multi Clipboard > Directory.

Thing is, for some reason on XP, even though I am a member of the Administrators group, every directory on my PC is some sort of Read-Only, as per the image below.

So whenever I attempt to click "OK" or "Apply" in the Multi-Clipboard preferences dialog after specifying a directory, I get a persistence error such as below. "The directory you selected can either not be read from or not be written to or both. Please select a readable and writable directory."

There is a way around this though. All I need to is edit the following file in my workspace: .metadata\.plugins\org.eclipse.core.runtime\.settings\de.babe.eclipse.plugins.MultiClipboard.prefs. I edit the clipboardSavePathPreference line to specify a directory, for example see below.

clipboardSavePathPreference=D\:\\path\\to\\eclipse\\workspace

I restart Eclipse and all is well with the world once more (for now).