*/
@Override
public void doAction(ActionEvent e) {
String action = e.getActionCommand();
if (action.equals(ActionNames.SUB_TREE_SAVED)) {
HashTree subTree = (HashTree) e.getSource();
subTree.traverse(this);
} else if (action.equals(ActionNames.SUB_TREE_LOADED)) {
ListedHashTree addTree = (ListedHashTree) e.getSource();
addTree.traverse(this);
} else if (action.equals(ActionNames.ADD_ALL)) {
previousGuiItems.clear();
GuiPackage.getInstance().getTreeModel().getTestPlan().traverse(this);
} else if (action.equals(ActionNames.CHECK_REMOVE)) {
GuiPackage guiPackage = GuiPackage.getInstance();
JMeterTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
removeMode = true;
for (int i = nodes.length - 1; i >= 0; i--) {
guiPackage.getTreeModel().getCurrentSubTree(nodes[i]).traverse(this);
}
removeMode = false;
}
// If we are merging in another test plan, we know the test plan is dirty now
if(action.equals(ActionNames.SUB_TREE_MERGED)) {
dirty = true;
}
else {
dirty = false;
checkMode = true;
HashTree wholeTree = GuiPackage.getInstance().getTreeModel().getTestPlan();
wholeTree.traverse(this);
checkMode = false;
}
GuiPackage.getInstance().setDirty(dirty);
}