Extension Guide : Add New UCM Element


  • The purpose of this guide is to give pointers on what tasks need to be accomplished when a new model element is to be added.
  • For simplification purposes, lets consider adding a new PathNode subclass.
  • This guide should be verified by the person actually following the guide.

Initial Steps

  • Read JUCMNav Dev Doc articles if you have the time smile
  • You'll need to add your model element to the palette so that it can be added.
  • Create a figure for your new model element (See Dev Doc Figures)
  • Create an editpart for your new element (See Dev Doc Edit Part Creation)
    • Register your figure in PathNodeEditPart.createFigure()
    • If you have lots of new behaviour, extend PathNodeEditPart and Register yourself in GraphicalEditPartFactory
    • Do same for outline (See Dev Doc Outline):
      • Simply add icon image in PathNodeTreeEditPart
      • Hopefully won't need to access TreeEditPartFactory

Optional Steps

  • You'll probably have some special "do something or other" that you'll want to add to the contextual menu.
  • Create a command that does your work (See Dev Doc Commands). Look at many command examples before attempting this; it is critical.
  • Create an action that maps a user selection to your command. (See Dev Doc Actions)
    • Don't forget to register your action in the action registry and context menu provider.


  • Any command you created implements JUCMNavCommand and must therefore implement testPreConditions()/testPostConditions(). (See Dev Doc Commands)
  • Create a simple test case in JUCMNavCommandTests; simply add a method and a few lines that execute your command. Find other examples.
  • You might want to create tests for your action (elsewhere) as well, if it is complicated.
  • See Dev Doc Checkout Code for running the tests.

-- Jason Kealey - 14 Jul 2005

Topic revision: r1 - 13 Jul 2005 - 21:04:51 - Jason Kealey
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback