IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentRootPath; if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentPath; if (entry != null && (sourceAttachmentPath = entry.getSourceAttachmentPath()) != null)
IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(path); IPath sourceAttachmentPath; if (entry != null && (sourceAttachmentPath = entry.getSourceAttachmentPath()) != null)
SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException { IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath()); String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding(); SourceMapper mapper = new SourceMapper( sourcePath, rootPath == null ? null : rootPath.toOSString(), getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options encoding); return mapper; }
SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException { IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath()); String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding(); SourceMapper mapper = new SourceMapper( sourcePath, rootPath == null ? null : rootPath.toOSString(), getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options encoding); return mapper; } /*
SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException { IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath()); String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding(); SourceMapper mapper = new SourceMapper( sourcePath, rootPath == null ? null : rootPath.toOSString(), getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options encoding); return mapper; } /*
SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException { IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath()); String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding(); SourceMapper mapper = new SourceMapper( sourcePath, rootPath == null ? null : rootPath.toOSString(), getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options encoding); return mapper; } /*
SourceMapper createSourceMapper(IPath sourcePath, IPath rootPath) throws JavaModelException { IClasspathEntry entry = ((JavaProject) getParent()).getClasspathEntryFor(getPath()); String encoding = (entry== null) ? null : ((ClasspathEntry) entry).getSourceAttachmentEncoding(); SourceMapper mapper = new SourceMapper( sourcePath, rootPath == null ? null : rootPath.toOSString(), getJavaProject().getOptions(true),// cannot use workspace options if external jar is 1.5 jar and workspace options are 1.4 options encoding); return mapper; } /*
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ @Override protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); if (org.eclipse.jdt.internal.compiler.util.Util.isJrt(path.toOSString())) { buff.append(JavaElement.JEM_MODULE); escapeMementoName(buff, getElementName()); } } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { // internal jar or regular root if (resource().getProject().equals(getJavaProject().getProject())) { path = underlyingResource.getProjectRelativePath(); } else { path = underlyingResource.getFullPath(); } } else { // external jar path = getPath(); } ((JavaElement)getParent()).getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, path.toString()); if (org.eclipse.jdt.internal.compiler.util.Util.isJrt(path.toOSString())) { buff.append(getHandleMementoDelimiter()); escapeMementoName(buff, getElementName()); } } /**
private ClasspathLocation mapToClassPathLocation( JavaModelManager manager, PackageFragmentRoot root) { ClasspathLocation cp = null; IPath path = root.getPath(); try { if (root.isArchive()) { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = new ClasspathJar(manager.getZipFile(path), rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } else { Object target = JavaModel.getTarget(path, true); if (target != null) { if (root.getKind() == IPackageFragmentRoot.K_SOURCE) { cp = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars()); } else { ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry(); cp = ClasspathLocation.forBinaryFolder((IContainer) target, false, rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true)); } } } } catch (CoreException e1) { // problem opening zip file or getting root kind // consider root corrupt and ignore } return cp; }