public ArrayList<Product> getSelectedProduct() {
		
		ArrayList<Product> products = new ArrayList<Product>();
		
		NodeItem selectedNode = getSelectedNode(); 
		if(selectedNode == null){
			return products;
		}
		Object o = selectedNode.getStoredObject();
		
		if(!(selectedNode == root)){
			//if it's a single node, return the class contained in it.
			if(!o.getClass().equals(Class.class)){				
				products.add((Product) o);
			}
			else
			{
				int n = JOptionPane.showConfirmDialog(
					    this.getParent(),
					    "This will delete all products in this category\n" + "Are you sure you wish to do this?" ,
					    "Delete Products",
					    JOptionPane.YES_NO_OPTION);
				if (n == 0)
				{
					//Get the children
					Enumeration<NodeItem> children = selectedNode.children();
					while (children.hasMoreElements())
					{
						NodeItem child = (NodeItem) children.nextElement();
						if (!child.getStoredObject().getClass().equals(Class.class)){
							products.add((Product) child.getStoredObject());
						}	
						//Recurse to get grandchildren
						if (child.getChildCount() > 0){
							products.addAll(EnumToList(child.children()));
						}
					}
				}
			}
		}
		return products;
	}