package com.c2kernel.gui.data; import java.util.ArrayList; import javax.swing.tree.DefaultMutableTreeNode; import com.c2kernel.collection.CollectionMember; import com.c2kernel.collection.Parent2ChildCollection; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.gui.EntityTabManager; import com.c2kernel.lookup.EntityPath; import com.c2kernel.lookup.InvalidEntityPathException; import com.c2kernel.utils.Logger; public class NodeCollection extends Node { ItemProxy parent; Parent2ChildCollection thisCollection; String path; public NodeCollection(ItemProxy parent, String name, EntityTabManager desktop) { this.desktop = desktop; this.parent = parent; this.name = name; this.path = parent.getSystemKey()+"/Collection/"+name; createTreeNode(); this.makeExpandable(); } @Override public void loadChildren() { Logger.msg(8, "NodeCollection::loadChildren()"); try { thisCollection = (Parent2ChildCollection)parent.getObject("Collection/"+name); } catch (ObjectNotFoundException ex) { end(false); return; } this.type = thisCollection.getClass().getName(); int lastDot = this.type.lastIndexOf('.'); if (lastDot > -1) this.type = this.type.substring(lastDot+1); ArrayList collectionMembers = thisCollection.getMembers().list; for (int i=0; i