*/
public void doAction(ActionEvent e) {
String action = e.getActionCommand();
if(action.equals(SUB_TREE_SAVED) || action.equals(SAVE))
{
HashTree subTree = GuiPackage.getInstance().getCurrentSubTree();
subTree.traverse(this);
}
else if(action.equals(SAVE_ALL) || action.equals(SAVE_TO_PREVIOUS))
{
HashTree subTree = GuiPackage.getInstance().getTreeModel().getTestPlan();
subTree.traverse(this);
}
else if(action.equals(SUB_TREE_LOADED))
{
ListedHashTree addTree = (ListedHashTree)e.getSource();
addTree.traverse(this);
}
else if(action.equals(ADD_ALL))
{
previousGuiItems.clear();
GuiPackage.getInstance().getTreeModel().getTestPlan().traverse(this);
}
else if(action.equals(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;
}
else if(action.equals(CHECK_DIRTY))
{
checkMode = true;
dirty = false;
HashTree wholeTree = GuiPackage.getInstance().getTreeModel().getTestPlan();
wholeTree.traverse(this);
GuiPackage.getInstance().setDirty(dirty);
checkMode = false;
}
}