workspace.setSelection(addRecipeToWorkspace(recipeCopy, node));
DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)getSelectedNode().getParent(); if (isSelectedNodeInExperiment()) addRecipeToWorkspace(recipeCopy, (DefaultMutableTreeNode)parentNode.getParent()); else addRecipeToWorkspace(recipeCopy, parentNode); recipeNames.add(newName);
  public RecipeComponent copyRecipe(RecipeComponent recipe) {    DefaultMutableTreeNode node =       (DefaultMutableTreeNode)findNode(recipe).getParent();    String newName = generateRecipeName(recipe.getRecipeName());    final RecipeComponent recipeCopy = (RecipeComponent)recipe.copy(newName);    GUIUtils.timeConsumingTaskStart(organizer);    try {      new Thread("DuplicateRecipe") {        public void run() {            recipeCopy.saveToDatabase();            GUIUtils.timeConsumingTaskEnd(organizer);        }      }.start();    } catch (RuntimeException re) {      if(log.isErrorEnabled()) {        log.error("Runtime exception duplicating recipe", re);      }      GUIUtils.timeConsumingTaskEnd(organizer);    }        workspace.setSelection(addRecipeToWorkspace(recipeCopy, node));    return recipeCopy;  }