Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core;
 
 import java.io.File;
 
 import  org.eclipse.core.resources.IResource;
 import  org.eclipse.core.runtime.IPath;
A package fragment root that corresponds to an external class folder.

NOTE: An external package fragment root never has an associated resource.

See also:
org.eclipse.jdt.core.IPackageFragmentRoot
org.eclipse.jdt.internal.core.PackageFragmentRootInfo
 
 public class ExternalPackageFragmentRoot extends PackageFragmentRoot {

The path to the external folder (an OS path)
 
 	protected final IPath externalPath;

Constructs a package fragment root which is the root of the Java package directory hierarchy based on an external folder that is not contained in a IJavaProject and does not have an associated IResource.
 
 	protected ExternalPackageFragmentRoot(IPath externalPathJavaProject project) {
 		super(nullproject);
 		this. = externalPath;
 	}
 
 	protected ExternalPackageFragmentRoot(IResource linkedFolder, IPath externalPathJavaProject project) {
 		super(linkedFolderproject);
 		this. = externalPath == null ? linkedFolder.getLocation() : externalPath;
 	}

An external class folder is always K_BINARY.
 
 	protected int determineKind(IResource underlyingResource) {
 	}
Returns true if this handle represents the same external folder as the given handle.

See also:
Object.equals
 
 	public boolean equals(Object o) {
 		if (this == o)
 			return true;
 		if (o instanceof ExternalPackageFragmentRoot) {
 			return this..equals(other.externalPath);
 		}
 		return false;
 	}
 	public String getElementName() {
 		return this..lastSegment();
 	}

See also:
IPackageFragmentRoot
 
 	public int getKind() {
 	}
 	int internalKind() throws JavaModelException {
 	}

See also:
IPackageFragmentRoot
 
 	public IPath getPath() {
 		return this.;
 	}

See also:
IJavaElement
 
 	public IResource getUnderlyingResource() throws JavaModelException {
 		return null;
 	}
 	public int hashCode() {
 		return this..hashCode();
	}

See also:
IPackageFragmentRoot
	public boolean isExternal() {
		return true;
	}
	public IResource resource(PackageFragmentRoot root) {
		if (this. == null)
			return this. = JavaModelManager.getExternalManager().getFolder(this.);
		return super.resource(root);
	}
	protected boolean resourceExists(IResource underlyingResource) {
		if (underlyingResource == null)
			return false;
		IPath location = underlyingResource.getLocation();
		if (location == null)
			return false;
		File file = location.toFile();
		if (file == null)
			return false;
		return file.exists();
	}
	protected void toStringAncestors(StringBuffer buffer) {
		// don't show project as it is irrelevant for external folders.
	}
New to GrepCode? Check out our FAQ X