// create the node collapse listener. We need this listener to ensure
// that a node is always selected. If a node is expanded and one of
// its children is the selected node the tree will have no nodes
// selected when the expanded node is collapsed.
collapseListener = new ITreeViewerListener() {
// javadoc inherited
public void treeCollapsed(TreeExpansionEvent event) {
// If the colapse event has resulted in nothing being selected
// then ensure that the node that was collapsed is selected
if (categoryTreeViewer.getSelection().isEmpty()) {