/plugins/ProjectViewer/tags/pv_2_0_2/projectviewer/vpt/package.html
# · HTML · 37 lines · 28 code · 9 blank · 0 comment · 0 complexity · b9d33dc3612ea202b5d8abd14c51675f MD5 · raw file
- <body><h3>Creating custom nodes.</h3>
- <p>It's possible to create new kinds of nodes to be inserted into a project.
- Although not tested, all the necessary functionality is available. To create
- a new kind of node, the following steps need to be taken:</p>
- <ul>
- <li>Create a new class that extends {@link projectviewer.vpt.VPTNode VPTNode}.
- It's highly recommended that the NodeType for your node is not one of the four
- constants defined in this class.</li>
- <li>Create a {@link projectviewer.persist.NodeHandler NodeHandler} to handle
- loading and saving of your node type. Don't forget to register the node handler
- in the <code>start()</code> method of your EditPlugin implementation.</li>
- <li>Create an {@link projectviewer.action.Action Action} that provides a way to
- import new nodes into a project. Optionally, you may use the code available in
- {@link projectviewer.importer.Importer Importer} to ease the importing of new
- nodes.</li>
- </ul>
- <p>These steps should be enough to create a new kind of node and make it be
- automatically persisted by the ProjectViewer plugin with the corresponding
- project. You may want to provide other actions to be executed on the given
- node (by creating more Action subclasses), or implement the
- {@link projectviewer.vpt.VPTNode#open() open()} method of the node to specify
- an action to be executed when the node receives a double click on the tree.
- When implementing <code>open()</code>, make sure to make the <code>close()</code>,
- <code>canOpen()</code> and <code>isOpened()</code> methods consistent with
- your implementation.</p>
- <p>Implementing new nodes should be considered highly experimental, so bear
- that in mind when going through this path.</p>
- </body>