{ List pSummaries = agentCtrl.getUserProjects(); DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); root.removeAllChildren(); if (pSummaries != null) { Iterator i = pSummaries.iterator(); ProjectSummary ps; DefaultMutableTreeNode pNode; while (i.hasNext()) { ps = (ProjectSummary) i.next(); pNode = new DefaultMutableTreeNode(ps); treeModel.insertNodeInto(pNode, root, root.getChildCount()); pNodes.put(new Integer(ps.getID()), pNode); addDatasetsToProject(ps, pNode, treeModel); } treeModel.reload(root); treeLoaded = true; } else { DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(""); treeModel.insertNodeInto(childNode, root, root.getChildCount()); treeModel.reload(root); view.tree.collapsePath(new TreePath(root.getPath())); } }
{ List pSummaries = agentCtrl.getUserProjects(); DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); root.removeAllChildren();  if (pSummaries != null && pSummaries.size() !=0 ) { Iterator i = pSummaries.iterator(); ProjectSummary ps; DefaultMutableTreeNode pNode; while (i.hasNext()) { ps = (ProjectSummary) i.next(); pNode = new DefaultMutableTreeNode(ps); treeModel.insertNodeInto(pNode, root, root.getChildCount()); pNodes.put(new Integer(ps.getID()), pNode); addDatasetsToProject(ps, pNode, treeModel); } treeModel.reload(root); treeLoaded = true; } else { treeModel.insertNodeInto(new DefaultMutableTreeNode(""), root, root.getChildCount()); treeModel.reload(root); view.tree.collapsePath(new TreePath(root.getPath())); } }
	void rebuildTree()	{		List pSummaries = agentCtrl.getUserProjects();		DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel();		root.removeAllChildren();		if (pSummaries != null) {			Iterator i = pSummaries.iterator();			ProjectSummary ps;			DefaultMutableTreeNode pNode;			while (i.hasNext()) {				ps = (ProjectSummary) i.next();				pNode = new DefaultMutableTreeNode(ps);				treeModel.insertNodeInto(pNode, root, root.getChildCount());				pNodes.put(new Integer(ps.getID()), pNode);				addDatasetsToProject(ps, pNode, treeModel);				}			treeModel.reload(root);			treeLoaded = true;			} else {			DefaultMutableTreeNode childNode = 										new DefaultMutableTreeNode("");			treeModel.insertNodeInto(childNode, root, root.getChildCount());			treeModel.reload(root);			view.tree.collapsePath(new TreePath(root.getPath()));		}		}