setLayout(new BorderLayout());
// tree
final DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Groups");
final JTree groupTree = new JTree(rootNode);
for (CmisTestGroup group : runner.getGroups()) {
final TestTreeNode groupNode = new TestTreeNode(groupTree, group);
rootNode.add(groupNode);
for (CmisTest test : group.getTests()) {
final TestTreeNode testNode = new TestTreeNode(groupTree, test);
groupNode.add(testNode);
}
}
((DefaultTreeModel) groupTree.getModel()).reload();
groupTree.setRootVisible(false);
groupTree.setCellRenderer(new TestTreeNodeRender());
groupTree.setCellEditor(new TestTreeNodeEditor());
groupTree.setEditable(true);
ToolTipManager.sharedInstance().registerComponent(groupTree);
for (int i = 0; i < groupTree.getRowCount(); i++) {
groupTree.expandRow(i);
}
final JPopupMenu treePopup = new JPopupMenu();
final JMenuItem selectItem = new JMenuItem("Select all");
selectItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectAll(groupTree, true);
}
});
treePopup.add(selectItem);
final JMenuItem deselectItem = new JMenuItem("Deselect all");
deselectItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectAll(groupTree, false);
}
});
treePopup.add(deselectItem);
groupTree.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
maybeShowPopup(e);
}
public void mouseReleased(MouseEvent e) {