/** * @see IRuntimeClasspathEntry#getResource() */ @Override public IResource getResource() { switch (getType()) { case CONTAINER: case VARIABLE: return null; default: return getResource(getPath()); } }
/** * @see IRuntimeClasspathEntry#getResource() */ @Override public IResource getResource() { switch (getType()) { case CONTAINER: case VARIABLE: return null; default: return getResource(getPath()); } }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentLocation() */ @Override public String getSourceAttachmentLocation() { IPath path = null; switch (getType()) { case VARIABLE : case ARCHIVE : IClasspathEntry resolved = getResolvedClasspathEntry(); if (resolved != null) { path = resolved.getSourceAttachmentPath(); } break; default : break; } return resolveToOSPath(path); }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentLocation() */ @Override public String getSourceAttachmentLocation() { IPath path = null; switch (getType()) { case VARIABLE : case ARCHIVE : IClasspathEntry resolved = getResolvedClasspathEntry(); if (resolved != null) { path = resolved.getSourceAttachmentPath(); } break; default : break; } return resolveToOSPath(path); }
/** * Initializes the classpath property based on this entry's type. */ private void initializeClasspathProperty() { switch (getType()) { case VARIABLE: if (getVariableName().equals(JavaRuntime.JRELIB_VARIABLE)) { setClasspathProperty(STANDARD_CLASSES); } else { setClasspathProperty(USER_CLASSES); } break; case PROJECT: case ARCHIVE: setClasspathProperty(USER_CLASSES); break; default: break; } }
/** * Initializes the classpath property based on this entry's type. */ private void initializeClasspathProperty() { switch (getType()) { case VARIABLE: if (getVariableName().equals(JavaRuntime.JRELIB_VARIABLE)) { setClasspathProperty(STANDARD_CLASSES); } else { setClasspathProperty(USER_CLASSES); } break; case PROJECT: case ARCHIVE: setClasspathProperty(USER_CLASSES); break; default: break; } }
/** * @see IRuntimeClasspathEntry#getSourceAttachmentRootLocation() */ @Override public String getSourceAttachmentRootLocation() { IPath path = null; switch (getType()) { case VARIABLE : case ARCHIVE : IClasspathEntry resolved = getResolvedClasspathEntry(); if (resolved != null) { path = resolved.getSourceAttachmentRootPath(); } break; default : break; } if (path != null) { return path.toOSString(); } return null; }
Element node = doc.createElement("runtimeClasspathEntry"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("type", (new Integer(getType())).toString()); //$NON-NLS-1$ node.setAttribute("path", (new Integer(getClasspathProperty())).toString()); //$NON-NLS-1$ switch (getType()) { case PROJECT : node.setAttribute("projectName", getPath().lastSegment()); //$NON-NLS-1$
Element node = doc.createElement("runtimeClasspathEntry"); //$NON-NLS-1$ doc.appendChild(node); node.setAttribute("type", (new Integer(getType())).toString()); //$NON-NLS-1$ node.setAttribute("path", (new Integer(getClasspathProperty())).toString()); //$NON-NLS-1$ switch (getType()) { case PROJECT : node.setAttribute("projectName", getPath().lastSegment()); //$NON-NLS-1$
/** * @see IRuntimeClasspathEntry#getSourceAttachmentRootLocation() */ @Override public String getSourceAttachmentRootLocation() { IPath path = null; switch (getType()) { case VARIABLE : case ARCHIVE : IClasspathEntry resolved = getResolvedClasspathEntry(); if (resolved != null) { path = resolved.getSourceAttachmentRootPath(); } break; default : break; } if (path != null) { return path.toOSString(); } return null; }
switch (getType()) { case PROJECT : IJavaProject pro = (IJavaProject) JavaCore.create(getResource());
/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }
switch (getType()) { case PROJECT : IJavaProject pro = (IJavaProject) JavaCore.create(getResource());
/** * Creates a new underlying classpath entry for this runtime classpath entry * with the given paths, due to a change in source attachment. * @param path the path * @param sourcePath the source path * @param rootPath the root path */ protected void updateClasspathEntry(IPath path, IPath sourcePath, IPath rootPath, IPath annotationsPath) { IClasspathEntry entry = null; IClasspathEntry original = getClasspathEntry(); switch (getType()) { case ARCHIVE: IClasspathAttribute[] extraAttributes = original.getExtraAttributes(); if (annotationsPath != null) { extraAttributes = setClasspathAttribute(extraAttributes, IClasspathAttribute.EXTERNAL_ANNOTATION_PATH, annotationsPath.toPortableString()); } entry = JavaCore.newLibraryEntry(path, sourcePath, rootPath, original.getAccessRules(), extraAttributes, original.isExported()); break; case VARIABLE: entry = JavaCore.newVariableEntry(path, sourcePath, rootPath); break; default: return; } setClasspathEntry(entry); }
if (obj instanceof IRuntimeClasspathEntry) { IRuntimeClasspathEntry r = (IRuntimeClasspathEntry)obj; if (getType() == r.getType() && getClasspathProperty() == r.getClasspathProperty()) { if (getType() == IRuntimeClasspathEntry.CONTAINER) { String id = getPath().segment(0); ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(id);
if (obj instanceof IRuntimeClasspathEntry) { IRuntimeClasspathEntry r = (IRuntimeClasspathEntry)obj; if (getType() == r.getType() && getClasspathProperty() == r.getClasspathProperty()) { if (getType() == IRuntimeClasspathEntry.CONTAINER) { String id = getPath().segment(0); ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(id);