1 11 package org.eclipse.jdt.internal.debug.ui.classpath; 12 13 import java.util.ArrayList ; 14 import java.util.List ; 15 16 17 public abstract class AbstractClasspathEntry implements IClasspathEntry { 18 19 protected List childEntries = new ArrayList (); 20 protected IClasspathEntry parent = null; 21 22 25 public void moveChild(boolean up, IClasspathEntry child) { 26 int index= childEntries.indexOf(child); 27 int direction= 1; 28 if (up) { 29 direction= -1; 30 } 31 Object moved= childEntries.get(index+direction); 32 childEntries.set(index + direction, child); 33 childEntries.set(index, moved); 34 } 35 36 39 public IClasspathEntry[] getEntries() { 40 return (IClasspathEntry[])childEntries.toArray(new IClasspathEntry[childEntries.size()]); 41 } 42 43 46 public boolean hasEntries() { 47 return !childEntries.isEmpty(); 48 } 49 50 53 public IClasspathEntry getParent() { 54 return parent; 55 } 56 57 60 public void setParent(IClasspathEntry parent) { 61 this.parent = parent; 62 } 63 } 64 | Popular Tags |