1 19 20 package org.netbeans.modules.tasklist.usertasks.util; 21 22 import org.netbeans.modules.tasklist.usertasks.model.UserTask; 23 import org.netbeans.modules.tasklist.usertasks.model.UserTaskList; 24 25 30 public class UTListTreeAbstraction implements TreeAbstraction<Object > { 31 private UserTaskList utl; 32 33 38 public UTListTreeAbstraction(UserTaskList utl) { 39 this.utl = utl; 40 } 41 42 public int getChildCount(Object obj) { 43 if (obj == utl) 44 return utl.getSubtasks().size(); 45 else 46 return ((UserTask) obj).getSubtasks().size(); 47 } 48 49 public Object getChild(Object obj, int index) { 50 if (obj == utl) 51 return utl.getSubtasks().get(index); 52 else 53 return ((UserTask) obj).getSubtasks().get(index); 54 } 55 56 public UserTaskList getRoot() { 57 return utl; 58 } 59 } 60 | Popular Tags |