1 11 package org.eclipse.ant.internal.ui.views.elements; 12 13 import java.util.ArrayList ; 14 import java.util.List ; 15 16 19 public class RootNode extends AntNode { 20 21 private List projects= new ArrayList (); 22 23 public RootNode() { 24 super(null); 25 } 26 27 32 public RootNode(ProjectNode[] projects) { 33 super(null); 34 for (int i = 0; i < projects.length; i++) { 35 this.projects.add(projects[i]); 36 } 37 } 38 39 44 public ProjectNode[] getProjects() { 45 return (ProjectNode[])projects.toArray(new ProjectNode[projects.size()]); 46 } 47 48 53 public boolean hasProjects() { 54 return !projects.isEmpty(); 55 } 56 57 62 public void addProject(ProjectNode project) { 63 projects.add(project); 64 } 65 66 72 public void removeProject(ProjectNode project) { 73 projects.remove(project); 74 } 75 76 80 public void removeAllProjects() { 81 projects.clear(); 82 } 83 84 } 85 | Popular Tags |