See http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Tutorials/DocumentExtension#Extension_page