Wednesday, March 23, 2011

Commands in Eclipse 3.x: the 10 most common patterns

A description of the different ways of using the Command Framework in Eclipse 3.x. I think our group has used them all and I believe we've done so properly. They are:
  1. Simple command with a default handler and a simple menu contribution for it.
  2. Providing static parameters to commands.
  3. Specifying a toggle state for a command.
  4. Specifying a radio state for a command.
  5. A pulldown command with sub-menu items.
  6. Dynamic menu contribution.
  7. Using "activeMenuSelection" in an expression.
  8. Adding a control to a toolbar - not sure if we've done this but I've seen it.
  9. PropertyTester.
  10. Calling Command Framework API, e.g. programmatic invocation.

No comments:

Post a Comment