/** * Returns a new element info for this element. */ protected Object createElementInfo() { return new PackageFragmentRootInfo(); }
/** * Returns an array of non-java resources contained in the receiver. */ synchronized Object[] getNonJavaResources(IJavaProject project, IResource underlyingResource, PackageFragmentRoot handle) { Object[] resources = this.nonJavaResources; if (resources == null) { resources = computeNonJavaResources(underlyingResource, handle); this.nonJavaResources = resources; } return resources; } /**
/** * @see IPackageFragmentRoot */ @Override public int getKind() throws JavaModelException { return ((PackageFragmentRootInfo)getElementInfo()).getRootKind(); }
/** * @see JavaElement */ @Override public SourceMapper getSourceMapper() { SourceMapper mapper; try { PackageFragmentRootInfo rootInfo = (PackageFragmentRootInfo) getElementInfo(); mapper = rootInfo.getSourceMapper(); if (mapper == null) { // first call to this method IPath sourcePath= getSourceAttachmentPath(); IPath rootPath= getSourceAttachmentRootPath(); if (sourcePath == null) mapper = createSourceMapper(getPath(), rootPath); // attach root to itself else mapper = createSourceMapper(sourcePath, rootPath); rootInfo.setSourceMapper(mapper); } } catch (JavaModelException e) { // no source can be attached mapper = null; } return mapper; }
/** * Returns an array of non-java resources contained in the receiver. */ Object[] getNonJavaResources(IResource underlyingResource, PackageFragmentRoot rootHandle) { if (this.nonJavaResources == null) { try { this.nonJavaResources = PackageFragmentRootInfo.computeFolderNonJavaResources( rootHandle, (IContainer)underlyingResource, rootHandle.fullInclusionPatternChars(), rootHandle.fullExclusionPatternChars()); } catch (JavaModelException e) { // root doesn't exist: consider package has no nonJavaResources this.nonJavaResources = NO_NON_JAVA_RESOURCES; } } return this.nonJavaResources; } /**
/** * For use by <code>AttachSourceOperation</code> only. * Sets the source mapper associated with this root. */ public void setSourceMapper(SourceMapper mapper) throws JavaModelException { ((PackageFragmentRootInfo) getElementInfo()).setSourceMapper(mapper); }
/** * @see Openable */ protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException { ((PackageFragmentRootInfo) info).setRootKind(determineKind(underlyingResource)); return computeChildren(info, underlyingResource); }
/** * Returns an array of non-java resources contained in the receiver. */ public Object[] getNonJavaResources() throws JavaModelException { return ((PackageFragmentRootInfo) getElementInfo()).getNonJavaResources(getJavaProject(), resource(), this); }
(PackageFragmentRoot) project.getPackageFragmentRoot(project.getProject()); if (projectRoot.isOpen()) { ((PackageFragmentRootInfo) projectRoot.getElementInfo()).setNonJavaResources(null); break; case IJavaElement.PACKAGE_FRAGMENT_ROOT : ((PackageFragmentRootInfo) info).setNonJavaResources(null);
continue nextResource; if (isClasspathEntry(member.getFullPath(), classpath)) continue nextResource; break; || isClasspathEntry(member.getFullPath(), classpath))) continue nextResource; break;
/** * @see JavaElement */ public SourceMapper getSourceMapper() { SourceMapper mapper; try { PackageFragmentRootInfo rootInfo = (PackageFragmentRootInfo) getElementInfo(); mapper = rootInfo.getSourceMapper(); if (mapper == null) { // first call to this method IPath sourcePath= getSourceAttachmentPath(); IPath rootPath= getSourceAttachmentRootPath(); if (sourcePath == null) mapper = createSourceMapper(getPath(), rootPath); // attach root to itself else mapper = createSourceMapper(sourcePath, rootPath); rootInfo.setSourceMapper(mapper); } } catch (JavaModelException e) { // no source can be attached mapper = null; } return mapper; }
/** * Returns an array of non-java resources contained in the receiver. */ Object[] getNonJavaResources(IResource underlyingResource, PackageFragmentRoot rootHandle) { if (this.nonJavaResources == null) { try { this.nonJavaResources = PackageFragmentRootInfo.computeFolderNonJavaResources( rootHandle, (IContainer)underlyingResource, rootHandle.fullInclusionPatternChars(), rootHandle.fullExclusionPatternChars()); } catch (JavaModelException e) { // root doesn't exist: consider package has no nonJavaResources this.nonJavaResources = NO_NON_JAVA_RESOURCES; } } return this.nonJavaResources; } /**
/** * For use by <code>AttachSourceOperation</code> only. * Sets the source mapper associated with this root. */ public void setSourceMapper(SourceMapper mapper) throws JavaModelException { ((PackageFragmentRootInfo) getElementInfo()).setSourceMapper(mapper); }
/** * @see Openable */ @Override protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException { ((PackageFragmentRootInfo) info).setRootKind(determineKind(underlyingResource)); return computeChildren(info, underlyingResource); }
/** * Returns an array of non-java resources contained in the receiver. */ public Object[] getNonJavaResources() throws JavaModelException { return ((PackageFragmentRootInfo) getElementInfo()).getNonJavaResources(getJavaProject(), resource(), this); }
(PackageFragmentRoot) project.getPackageFragmentRoot(project.getProject()); if (projectRoot.isOpen()) { ((PackageFragmentRootInfo) projectRoot.getElementInfo()).setNonJavaResources(null); break; case IJavaElement.PACKAGE_FRAGMENT_ROOT : ((PackageFragmentRootInfo) info).setNonJavaResources(null);
continue nextResource; if (isClasspathEntry(member.getFullPath(), classpath)) continue nextResource; break; || isClasspathEntry(member.getFullPath(), classpath))) continue nextResource; break;
/** * @see JavaElement */ public SourceMapper getSourceMapper() { SourceMapper mapper; try { PackageFragmentRootInfo rootInfo = (PackageFragmentRootInfo) getElementInfo(); mapper = rootInfo.getSourceMapper(); if (mapper == null) { // first call to this method IPath sourcePath= getSourceAttachmentPath(); IPath rootPath= getSourceAttachmentRootPath(); if (sourcePath == null) mapper = createSourceMapper(getPath(), rootPath); // attach root to itself else mapper = createSourceMapper(sourcePath, rootPath); rootInfo.setSourceMapper(mapper); } } catch (JavaModelException e) { // no source can be attached mapper = null; } return mapper; }
/** * @see IPackageFragmentRoot */ public int getKind() throws JavaModelException { return ((PackageFragmentRootInfo)getElementInfo()).getRootKind(); }
/** * Returns a new element info for this element. */ protected Object createElementInfo() { return new PackageFragmentRootInfo(); }