Java Code Examples for org.eclipse.jdt.core.IClasspathContainer#K_SYSTEM

The following examples show how to use org.eclipse.jdt.core.IClasspathContainer#K_SYSTEM . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CPUserLibraryElement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public CPUserLibraryElement(String name, IClasspathContainer container, IJavaProject project) {
	fName= name;
	fChildren= new ArrayList<CPListElement>();
	if (container != null) {
		IClasspathEntry[] entries= container.getClasspathEntries();
		CPListElement[] res= new CPListElement[entries.length];
		for (int i= 0; i < res.length; i++) {
			IClasspathEntry curr= entries[i];
			CPListElement elem= CPListElement.createFromExisting(this, curr, project);
			//elem.setAttribute(CPListElement.SOURCEATTACHMENT, curr.getSourceAttachmentPath());
			//elem.setAttribute(CPListElement.JAVADOC, JavaUI.getLibraryJavadocLocation(curr.getPath()));
			fChildren.add(elem);
		}
		fIsSystemLibrary= container.getKind() == IClasspathContainer.K_SYSTEM;
	} else {
		fIsSystemLibrary= false;
	}
}
 
Example 2
Source File: CPUserLibraryElement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public boolean hasChanges(IClasspathContainer oldContainer) {
	if (oldContainer == null || (oldContainer.getKind() == IClasspathContainer.K_SYSTEM) != fIsSystemLibrary) {
		return true;
	}
	IClasspathEntry[] oldEntries= oldContainer.getClasspathEntries();
	if (fChildren.size() != oldEntries.length) {
		return true;
	}
	for (int i= 0; i < oldEntries.length; i++) {
		CPListElement child= fChildren.get(i);
		if (!child.getClasspathEntry().equals(oldEntries[i])) {
			return true;
		}
	}
	return false;
}
 
Example 3
Source File: CPUserLibraryElement.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public int getKind() {
	return isSystemLibrary() ? IClasspathContainer.K_SYSTEM : K_APPLICATION;
}