Monday, October 15, 2007

Eclipse Commands

The new command framework for Eclipse looks quite good. But I found it a little hard to get started with it.

I've found some really useful info here though:
One problem I've encountered though, is how to determine the command Id for an existing workbench function. In this case, I wanted the "Help -> About" function to be present in my RCP app.

I stumbled across a simple solution - cheat! That is, use the Cheat Sheets wizard to give a helping hand. (Thanks to Chris Aniszczyk for his informative article on Cheat Sheets - reading it gave me the inspiration for this!)
  1. Create a new cheat sheet, by selecting File -> New ... and then selecting "Cheat Sheet".
  2. Just use any name, and specify a "Simple" cheat sheet.
  3. Once in the editor, select the "Item" - and on the right hand side of the form, you will be able to specify a command - using the gift of Browse.
  4. Click on the Browse button, and you'll be presented with a list of common workbench commands. For example:
  5. You can then select the Command, and even press "Execute" to try it.
I've found this a handy trick.

No comments: