if (! pdb.isRecipeUsed(recipe)) pdb.removeLibRecipe(recipe);
if (! pdb.isRecipeUsed(recipe)) helper.deleteRecipe(recipe.getRecipeName());
  private void deleteRecipeInNode(DefaultMutableTreeNode recipeNode) {    RecipeComponent recipe = (RecipeComponent) recipeNode.getUserObject();    model.removeNodeFromParent(recipeNode);    // if deleted last reference to recipe in the workspace    // ask if recipe should be deleted from database and delete it    if (findNodeNamed(recipe.getRecipeName()) != null)      return;    try {      PDbBase pdb = new PDbBase();      try {        int status = pdb.recipeExists(recipe);        if (status == PDbBase.RECIPE_STATUS_EXISTS ||            status == PDbBase.RECIPE_STATUS_DIFFERS) {          int answer =            JOptionPane.showConfirmDialog(this,                                          "Delete recipe " +                                          recipe.getRecipeName() +                                          " from database?",                                          "Delete Recipe",                                          JOptionPane.YES_NO_OPTION);          if (answer == JOptionPane.YES_OPTION) {	    // Even if the user wanted it removed, only remove	    // it if it is not in use, including any experiments	    // currently in the workspace	    if (! pdb.isRecipeUsed(recipe))	      pdb.removeLibRecipe(recipe);          }        }      } finally {	if (pdb != null)	  pdb.close();      }    } catch (Exception e) {      JOptionPane.showMessageDialog(this,                                    "An exception occurred deleting the recipe from the database",                                    "Error Writing Database",                                    JOptionPane.ERROR_MESSAGE);      if (log.isErrorEnabled()) {	log.error("Error removing recipe from DB", e);      }    }    recipeNames.remove(recipe.getRecipeName());  }