1 15 package org.apache.tapestry.workbench.tree.examples.fsmodel; 16 17 import java.io.File ; 18 import java.util.ArrayList ; 19 import java.util.Collection ; 20 21 import org.apache.tapestry.contrib.tree.model.ITreeNode; 22 23 public class FileObject extends SFObject { 24 private long m_lSize; 25 26 public FileObject(ITreeNode objParent, File objFile) { 27 super(objParent, objFile); 28 init(); 29 } 30 31 protected void init() { 32 super.init(); 33 m_lSize = m_objFile.length(); 34 } 35 36 public long getSize() { 37 return m_lSize; 38 } 39 40 43 public boolean containsChild(ITreeNode node) { 44 return false; 45 } 46 47 50 public boolean getAllowsChildren() { 51 return false; 52 } 53 54 57 public int getChildCount() { 58 return 0; 59 } 60 61 64 public Collection getChildren() { 65 return new ArrayList (); 66 } 67 68 71 public boolean isLeaf() { 72 return true; 73 } 74 75 78 public AssetsHolder getAssets() { 79 if (m_objAssetsHolder == null) { 80 final String a = "/org/apache/tapestry/workbench/tree/examples/fsmodel/file.gif"; 81 m_objAssetsHolder = new AssetsHolder(a, a); 82 } 83 return m_objAssetsHolder; 84 } 85 } 86 | Popular Tags |