1 11 package org.eclipse.pde.internal.ui.elements; 12 13 import java.util.Vector ; 14 15 import org.eclipse.swt.graphics.Image; 16 17 18 public class ElementList extends NamedElement { 19 private Vector children = new Vector (); 20 21 public ElementList(String name) { 22 super(name); 23 } 24 public ElementList(String name, Image icon) { 25 super(name, icon); 26 } 27 public ElementList(String name, Image icon, IPDEElement parent) { 28 super(name, icon, parent); 29 } 30 public void add(IPDEElement child) { 31 children.addElement(child); 32 } 33 public Object [] getChildren() { 34 if (children.size()==0) return new Object [0]; 35 Object [] result = new Object [children.size()]; 36 children.copyInto(result); 37 return result; 38 } 39 public void remove(IPDEElement child) { 40 children.remove(child); 41 } 42 public int size() { 43 return children.size(); 44 } 45 public String toString() { 46 return children.toString(); 47 } 48 } 49 | Popular Tags |