Follow by Email

Thursday, May 20, 2010

A little fun with The Preference Recorder

Here's a clever little trick you can use with the Preference Recorder in the Workspace Mechanic for Eclipse:

Let's say you built a Preference Task that you want to apply to your workspace. So you put the .epf file in one of the registered directories.

Turn on the Preference Recorder. Let the Workspace Mechanic scan for, and run tasks. It should find your new .epf and offer to apply it, and any other tasks that fail the evaluation phase. After the repair phase completes, turn off the Preference Recorder and see what changes were actually applied.

Kind of fun. If you find that kind of thing fun.

9 comments:

davidplass said...

Ah! Meta recording!

Also you have extra square brackets.

Robert Konigsberg said...

Eep! Thanks.

ekke said...

can I use variables to define the registered directories ?
then I could have a directory in my eclipse installation or workspace

...will try out the workspace mechanic to ease the installation of redView

another question: sharing working set definitions between workspaces would also be great. if I understand right I have write some code for this

ekke

Robert Konigsberg said...

ekke,

You can't use variables to define the registered directories. What would be the benefit of per-workspace tasks?

Also yes, you would have to write some code for managing working set definitions. You may see there's some incomplete code in the base that has (mostly) dealt with mapping keyboard bindings as a task. The problem there is that keyboard bindings are stored as ONE GIANT XML PREFERENCE, which can be somewhat handled, but no, not really, and as such, a special task and special input format are required; we plan to define them via a JSON interface. That said, you can get the idea from that -- we even merely abandoned the .preference format and went straight for mutating keyboard bindings via the API.

I'm sorry we didn't get the keyboard task done before launch, it's one of the extras I really hoped we would finish.

ekke said...

robert,
I could put the tasks into a small mercurial repo,
so each user would have them per ex at
/mechanic
and all would be updated from repo etc
ekke

ekke said...

...i meant at
workspaceroot/mechanic

Robert Konigsberg said...

Interesting idea.

Robert Konigsberg said...

Task-supplied directories are in fact variable resolved, but they don't remain that way. We added the variable resolver merely to support the abstraction of defining a %HOME%/.eclipse/audits directory as the user's default. If you were interested in variable resolution of task directories, the UI for specifying task directories in the mechanic preferences dialog would need rewriting.

Robert Konigsberg said...
This comment has been removed by the author.