1 11 package org.eclipse.jdt.internal.launching; 12 13 import org.eclipse.core.resources.IResource; 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.core.runtime.IPath; 16 import org.eclipse.core.runtime.IStatus; 17 import org.eclipse.core.runtime.PlatformObject; 18 import org.eclipse.core.runtime.Status; 19 import org.eclipse.debug.core.DebugPlugin; 20 import org.eclipse.jdt.core.IClasspathEntry; 21 import org.eclipse.jdt.core.IJavaProject; 22 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 23 import org.eclipse.jdt.launching.IRuntimeClasspathEntry; 24 import org.eclipse.jdt.launching.IRuntimeClasspathEntry2; 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 28 36 public abstract class AbstractRuntimeClasspathEntry extends PlatformObject implements IRuntimeClasspathEntry2 { 37 38 private IPath sourceAttachmentPath = null; 39 private IPath rootSourcePath = null; 40 private int classpathProperty = IRuntimeClasspathEntry.USER_CLASSES; 41 44 private IJavaProject fJavaProject; 45 46 53 public boolean isComposite() { 54 return false; 55 } 56 57 64 public IRuntimeClasspathEntry[] getRuntimeClasspathEntries() throws CoreException { 65 return new IRuntimeClasspathEntry[0]; 66 } 67 68 75 protected void abort(String message, Throwable exception) throws CoreException { 76 IStatus status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), IJavaLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, exception); 77 throw new CoreException(status); 78 } 79 80 89 public String getMemento() throws CoreException { 90 Document doc= DebugPlugin.newDocument(); 91 Element root = doc.createElement("runtimeClasspathEntry"); doc.appendChild(root); 93 root.setAttribute("id", getTypeId()); Element memento = doc.createElement("memento"); root.appendChild(memento); 96 buildMemento(doc, memento); 97 return DebugPlugin.serializeDocument(doc); 98 } 99 100 109 protected abstract void buildMemento(Document document, Element memento) throws CoreException; 110 111 118 public IPath getPath() { 119 return null; 120 } 121 122 129 public IResource getResource() { 130 return null; 131 } 132 133 136 public IPath getSourceAttachmentPath() { 137 return sourceAttachmentPath; 138 } 139 142 public void setSourceAttachmentPath(IPath path) { 143 sourceAttachmentPath = path; 144 } 145 148 public IPath getSourceAttachmentRootPath() { 149 return rootSourcePath; 150 } 151 154 public void setSourceAttachmentRootPath(IPath path) { 155 rootSourcePath = path; 156 } 157 160 public int getClasspathProperty() { 161 return classpathProperty; 162 } 163 166 public void setClasspathProperty(int property) { 167 classpathProperty = property; 168 } 169 176 public String getLocation() { 177 return null; 178 } 179 180 186 public String getSourceAttachmentLocation() { 187 return null; 188 } 189 195 public String getSourceAttachmentRootLocation() { 196 return null; 197 } 198 205 public String getVariableName() { 206 return null; 207 } 208 215 public IClasspathEntry getClasspathEntry() { 216 return null; 217 } 218 221 public IJavaProject getJavaProject() { 222 return fJavaProject; 223 } 224 225 230 protected void setJavaProject(IJavaProject javaProject) { 231 fJavaProject = javaProject; 232 } 233 } 234 | Popular Tags |