Add tree node
A tree node extension point is used to add a tree node to the navigation view and associate it with a content page.
The following code extract is taken from the file, plugin.xml, from the simple plug-in and shows a basic implementation of the tree node extension point:<extension id="com.ibm.mq.explorer.samples.simpleTreeNode" name="Simple TreeNode" point="com.ibm.mq.explorer.ui.addtreenode"> <treeNode pluginId="com.ibm.mq.explorer.sample.simple" name="com.ibm.mq.explorer.sample.simple" class="com.ibm.mq.explorer.sample.simple.SimpleTreeNodeFactory" treeNodeId="com.ibm.mq.explorer.sample.simple" sequence="888"> </treeNode> </extension>As well as declaring the tree node extension point in plugin.xml, the following classes are needed:
- A class that contains a method that checks the ID of any incoming tree node to determine whether to add sub nodes to it. This class must implement com.ibm.mq.explorer.ui.extensions.ITreeNodeFactory, and IExecutableExtension. For the methods that this class must contain, refer to the IBM MQ Explorer Javadoc documentation. For information on how to access the IBM MQ Explorer Javadoc documentation, see API Reference.
A working example of this class is available in the simple plugin, called SimpleTreeNodeFactory.java
- A class that contains methods that return information about any new tree nodes, such as the name, ID, and the associated content page class. This class must extend com.ibm.mq.ui.extensions.TreeNode. For the methods that this class must contain refer to the IBM MQ Explorer Javadoc.
A working example of this class is available in the simple plugin, called SimpleTreeNode.java.