/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { HashMap rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation()); } else { rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { HashMap rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation()); } else { rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { HashMap rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation()); } else { rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
element = rootInfo == null ? JavaCore.create(resource) : rootInfo.getPackageFragmentRoot(resource); break; case IJavaElement.PACKAGE_FRAGMENT: if (rootInfo != null) { if (rootInfo.project.contains(resource)) { PackageFragmentRoot root = (PackageFragmentRoot) rootInfo.getPackageFragmentRoot(null);
element = rootInfo == null ? JavaCore.create(resource) : rootInfo.getPackageFragmentRoot(resource); break; case IJavaElement.PACKAGE_FRAGMENT: if (rootInfo != null) { if (rootInfo.project.contains(resource)) { PackageFragmentRoot root = (PackageFragmentRoot) rootInfo.getPackageFragmentRoot(null);
/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { HashMap rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation()); } else { rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { HashMap rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation()); } else { rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
/** * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String) */ @Override public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) { Map<IPath, RootInfo> rootInfos = JavaModelManager.getDeltaState().roots; DeltaProcessor.RootInfo rootInfo = null; if (jarPath != null) { IPath path = new Path(jarPath); rootInfo = rootInfos.get(path); } else { IPath path = new Path(resourcePathString); if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) { IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/)); if (resource != null) rootInfo = rootInfos.get(resource.getLocation()); } else { rootInfo = rootInfos.get(path); while (rootInfo == null && path.segmentCount() > 0) { path = path.removeLastSegments(1); rootInfo = rootInfos.get(path); } } } if (rootInfo == null) return null; return rootInfo.getPackageFragmentRoot(null/*no resource hint*/); }
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { if (this.root == null) { if (resource != null) { this.root = this.project.getPackageFragmentRoot(resource); } else { this.root = getPackageFragmentRoot(); } } if (this.root != null) this.cache = this.root; return this.root; } boolean isRootOfProject(IPath path) {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {
RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { this.project = project; this.rootPath = rootPath; this.inclusionPatterns = inclusionPatterns; this.exclusionPatterns = exclusionPatterns; this.entryKind = entryKind; this.cache = getPackageFragmentRoot(); } public IPackageFragmentRoot getPackageFragmentRoot() {