@Override public boolean equals(Object other) { if (other != null && other.getClass().equals(getClass())) { CPListElement elem= (CPListElement) other; return getClasspathEntry().equals(elem.getClasspathEntry()); } return false; }
@Override public boolean equals(Object other) { if (other != null && other.getClass().equals(getClass())) { CPListElement elem= (CPListElement) other; return getClasspathEntry().equals(elem.getClasspathEntry()); } return false; }
public IClasspathEntry[] getClasspathEntries() { IClasspathEntry[] result= new IClasspathEntry[fCPListElements.size()]; int i= 0; for (Iterator<CPListElement> iterator= fCPListElements.iterator(); iterator.hasNext();) { CPListElement element= iterator.next(); result[i]= element.getClasspathEntry(); i++; } return result; }
public IClasspathEntry[] getClasspathEntries() { IClasspathEntry[] result= new IClasspathEntry[fCPListElements.size()]; int i= 0; for (Iterator iterator= fCPListElements.iterator(); iterator.hasNext();) { CPListElement element= (CPListElement)iterator.next(); result[i]= element.getClasspathEntry(); i++; } return result; }
public static IClasspathEntry[] convertToClasspathEntries(List<CPListElement> cpList) { IClasspathEntry[] result= new IClasspathEntry[cpList.size()]; int i= 0; for (Iterator<CPListElement> iter= cpList.iterator(); iter.hasNext();) { CPListElement cur= iter.next(); result[i]= cur.getClasspathEntry(); i++; } return result; }
public IClasspathEntry[] getClasspathEntries() { IClasspathEntry[] result= new IClasspathEntry[fCPListElements.size()]; int i= 0; for (Iterator<CPListElement> iterator= fCPListElements.iterator(); iterator.hasNext();) { CPListElement element= iterator.next(); result[i]= element.getClasspathEntry(); i++; } return result; }
@Override public IClasspathEntry getParentClasspassEntry() { return getParent().getClasspathEntry(); } };
@Override public IClasspathEntry[] getClasspathEntries() { CPListElement[] children= getChildren(); IClasspathEntry[] entries= new IClasspathEntry[children.length]; for (int i= 0; i < entries.length; i++) { entries[i]= children[i].getClasspathEntry(); } return entries; }
private ImageDescriptor getCPListElementBaseImage(CPListElement cpentry) { IClasspathEntry classpathEntry= cpentry.getClasspathEntry(); boolean isTest= classpathEntry != null && classpathEntry.isTest(); return getCPListElementBaseImage(cpentry, isTest); }
private IClasspathEntry[] getRawClasspath() { IClasspathEntry[] currEntries= new IClasspathEntry[fClassPathList.getSize()]; for (int i= 0; i < currEntries.length; i++) { CPListElement curr= (CPListElement) fClassPathList.getElement(i); currEntries[i]= curr.getClasspathEntry(); } return currEntries; }
private IClasspathEntry[] getRawClasspath() { IClasspathEntry[] currEntries = new IClasspathEntry[fAspectPathList .getSize()]; for (int i = 0; i < currEntries.length; i++) { CPListElement curr = (CPListElement) fAspectPathList.getElement(i); currEntries[i] = curr.getClasspathEntry(); } return currEntries; }
private IClasspathEntry[] getRawClasspath() { IClasspathEntry[] currEntries= new IClasspathEntry[fInPathList.getSize()]; for (int i= 0; i < currEntries.length; i++) { CPListElement curr= (CPListElement) fInPathList.getElement(i); currEntries[i]= curr.getClasspathEntry(); } return currEntries; }
public void setURL(URL url, IProgressMonitor monitor) throws CoreException { if (isProjectRef()) { JavaUI.setProjectJavadocLocation(fProject, url); } else { CPListElement element= CPListElement.createFromExisting(fClasspathEntry, fProject); String location= url != null ? url.toExternalForm() : null; element.setAttribute(CPListElement.JAVADOC, location); String[] changedAttributes= { CPListElement.JAVADOC }; BuildPathSupport.modifyClasspathEntry(null, element.getClasspathEntry(), changedAttributes, fProject, fContainerPath, monitor); fClasspathEntry= element.getClasspathEntry(); } }
public void setURL(URL url, IProgressMonitor monitor) throws CoreException { if (isProjectRef()) { JavaUI.setProjectJavadocLocation(fProject, url); } else { CPListElement element= CPListElement.createFromExisting(fClasspathEntry, fProject); String location= url != null ? url.toExternalForm() : null; element.setAttribute(CPListElement.JAVADOC, location); String[] changedAttributes= { CPListElement.JAVADOC }; BuildPathSupport.modifyClasspathEntry(null, element.getClasspathEntry(), changedAttributes, fProject, fContainerPath, fClasspathEntry.getReferencingEntry() != null, monitor); fClasspathEntry= element.getClasspathEntry(); } }
public void setURL(URL url, IProgressMonitor monitor) throws CoreException { if (isProjectRef()) { JavaUI.setProjectJavadocLocation(fProject, url); } else { CPListElement element= CPListElement.createFromExisting(fClasspathEntry, fProject); String location= url != null ? url.toExternalForm() : null; element.setAttribute(CPListElement.JAVADOC, location); String[] changedAttributes= { CPListElement.JAVADOC }; BuildPathSupport.modifyClasspathEntry(null, element.getClasspathEntry(), changedAttributes, fProject, fContainerPath, fClasspathEntry.getReferencingEntry() != null, monitor); fClasspathEntry= element.getClasspathEntry(); } }
private void attributeUpdated(CPListElement selElement, String[] changedAttributes) { Object parentContainer= selElement.getParentContainer(); if (parentContainer instanceof CPListElement) { // inside a container: apply changes right away IClasspathEntry updatedEntry= selElement.getClasspathEntry(); updateContainerEntry(updatedEntry, changedAttributes, fCurrJProject, ((CPListElement) parentContainer).getPath()); } }
private static IClasspathEntry getUpdatedEntry(IClasspathEntry currEntry, IClasspathEntry updatedEntry, String[] updatedAttributes, IJavaProject jproject) { if (updatedAttributes == null) { return updatedEntry; // used updated entry 'as is' } CPListElement currElem= CPListElement.createFromExisting(currEntry, jproject); CPListElement newElem= CPListElement.createFromExisting(updatedEntry, jproject); for (int i= 0; i < updatedAttributes.length; i++) { String attrib= updatedAttributes[i]; currElem.setAttribute(attrib, newElem.getAttribute(attrib)); } return currElem.getClasspathEntry(); }
public IClasspathEntry getNewEntry() { CPListElement elem= CPListElement.createFromExisting(fEntry, fProject); IPath sourceAttachmentPath= getSourceAttachmentPath(); String encoding= getEncoding(); elem.setAttribute(CPListElement.SOURCEATTACHMENT, sourceAttachmentPath); elem.setAttribute(CPListElement.SOURCE_ATTACHMENT_ENCODING, encoding); return elem.getClasspathEntry(); }
private IPackageFragmentRoot[] findRoots(CPListElement element) { IClasspathEntry entry= element.getClasspathEntry(); IPackageFragmentRoot[] roots= element.getJavaProject().findPackageFragmentRoots(entry); if (roots.length == 0) { // 2nd attempt in case "module=true" is not explicit on the real cp entry: entry= copyCPEntryWithoutModuleAttribute(entry); if (entry != null) roots= element.getJavaProject().findPackageFragmentRoots(entry); } return roots; }
public static boolean isProjectSourceFolder(CPListElement[] existing, IJavaProject project) { IPath projPath= project.getProject().getFullPath(); for (int i= 0; i < existing.length; i++) { IClasspathEntry curr= existing[i].getClasspathEntry(); if (curr.getEntryKind() == IClasspathEntry.CPE_SOURCE) { if (projPath.equals(curr.getPath())) { return true; } } } return false; }