Java Code Examples for org.eclipse.jdt.core.IJavaElement#PACKAGE_FRAGMENT_ROOT

The following examples show how to use org.eclipse.jdt.core.IJavaElement#PACKAGE_FRAGMENT_ROOT . 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: DeleteResourceElementsOperation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @see MultiOperation
 */
protected void verify(IJavaElement element) throws JavaModelException {
	if (element == null || !element.exists())
		error(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element);

	int type = element.getElementType();
	if (type <= IJavaElement.PACKAGE_FRAGMENT_ROOT || type > IJavaElement.COMPILATION_UNIT)
		error(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, element);
	else if (type == IJavaElement.PACKAGE_FRAGMENT && element instanceof JarPackageFragment)
		error(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, element);
	IResource resource = ((JavaElement) element).resource();
	if (resource instanceof IFolder) {
		if (resource.isLinked()) {
			error(IJavaModelStatusConstants.INVALID_RESOURCE, element);
		}
	}
}
 
Example 2
Source File: CopyToClipboardAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void processJavaElements(Set<String> fileNames, StringBuffer namesBuf) {
	for (int i= 0; i < fJavaElements.length; i++) {
		IJavaElement element= fJavaElements[i];
		switch (element.getElementType()) {
			case IJavaElement.JAVA_PROJECT :
			case IJavaElement.PACKAGE_FRAGMENT_ROOT :
			case IJavaElement.PACKAGE_FRAGMENT :
			case IJavaElement.COMPILATION_UNIT :
			case IJavaElement.CLASS_FILE :
				addFileName(fileNames, ReorgUtils.getResource(element));
				break;
			default :
				break;
		}

		if (namesBuf.length() > 0 || i > 0)
			namesBuf.append(System.getProperty("line.separator")); //$NON-NLS-1$
		namesBuf.append(getName(element));
	}
}
 
Example 3
Source File: JavaSearchScope.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private IPath getPath(IJavaElement element, boolean relativeToRoot) {
	switch (element.getElementType()) {
		case IJavaElement.JAVA_MODEL:
			return Path.EMPTY;
		case IJavaElement.JAVA_PROJECT:
			return element.getPath();
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (relativeToRoot)
				return Path.EMPTY;
			return element.getPath();
		case IJavaElement.PACKAGE_FRAGMENT:
			String relativePath = Util.concatWith(((PackageFragment) element).names, '/');
			return getPath(element.getParent(), relativeToRoot).append(new Path(relativePath));
		case IJavaElement.COMPILATION_UNIT:
		case IJavaElement.CLASS_FILE:
			return getPath(element.getParent(), relativeToRoot).append(new Path(element.getElementName()));
		default:
			return getPath(element.getParent(), relativeToRoot);
	}
}
 
Example 4
Source File: FindStringsToExternalizeAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private boolean computeEnablementState(IStructuredSelection selection) throws JavaModelException {
	if (selection.isEmpty())
		return false;
	for (Iterator<?> iter= selection.iterator(); iter.hasNext();) {
		Object element= iter.next();
		if (!(element instanceof IJavaElement))
			return false;
		IJavaElement javaElement= (IJavaElement)element;
		if (! javaElement.exists() || javaElement.isReadOnly())
			return false;
		int elementType= javaElement.getElementType();
		if (elementType != IJavaElement.PACKAGE_FRAGMENT &&
			elementType != IJavaElement.PACKAGE_FRAGMENT_ROOT &&
			elementType != IJavaElement.JAVA_PROJECT)
			return false;
		if (elementType == IJavaElement.PACKAGE_FRAGMENT_ROOT){
			IPackageFragmentRoot root= (IPackageFragmentRoot)javaElement;
			if (root.isExternal() || ReorgUtils.isClassFolder(root))
				return false;
		}
	}
	return true;
}
 
Example 5
Source File: JavaModelCache.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 *  Returns the info for this element without
 *  disturbing the cache ordering.
 */
protected Object peekAtInfo(IJavaElement element) {
	switch (element.getElementType()) {
		case IJavaElement.JAVA_MODEL:
			return this.modelInfo;
		case IJavaElement.JAVA_PROJECT:
			return this.projectCache.get(element);
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			return this.rootCache.peek(element);
		case IJavaElement.PACKAGE_FRAGMENT:
			return this.pkgCache.peek(element);
		case IJavaElement.COMPILATION_UNIT:
		case IJavaElement.CLASS_FILE:
			return this.openableCache.peek(element);
		case IJavaElement.TYPE:
			Object result = this.jarTypeCache.peek(element);
			if (result != null)
				return result;
			else
				return this.childrenCache.get(element);
		default:
			return this.childrenCache.get(element);
	}
}
 
Example 6
Source File: OpenAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Selects the openable elements out of the given ones.
 *
 * @param elements the elements to filter
 * @return the openable elements
 * @since 3.4
 */
private IJavaElement[] selectOpenableElements(IJavaElement[] elements) {
	List<IJavaElement> result= new ArrayList<IJavaElement>(elements.length);
	for (int i= 0; i < elements.length; i++) {
		IJavaElement element= elements[i];
		switch (element.getElementType()) {
			case IJavaElement.PACKAGE_DECLARATION:
			case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			case IJavaElement.JAVA_PROJECT:
			case IJavaElement.JAVA_MODEL:
				break;
			default:
				result.add(element);
				break;
		}
	}
	return result.toArray(new IJavaElement[result.size()]);
}
 
Example 7
Source File: JavaElementResourceMapping.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public static ResourceMapping create(IJavaElement element) {
	switch (element.getElementType()) {
		case IJavaElement.TYPE:
			return create((IType)element);
		case IJavaElement.COMPILATION_UNIT:
			return create((ICompilationUnit)element);
		case IJavaElement.CLASS_FILE:
			return create((IClassFile)element);
		case IJavaElement.PACKAGE_FRAGMENT:
			return create((IPackageFragment)element);
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			return create((IPackageFragmentRoot)element);
		case IJavaElement.JAVA_PROJECT:
			return create((IJavaProject)element);
		case IJavaElement.JAVA_MODEL:
			return create((IJavaModel)element);
		default:
			return null;
	}

}
 
Example 8
Source File: ReorgPolicyFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public boolean canChildrenBeDestinations(IJavaElement javaElement) {
	switch (javaElement.getElementType()) {
		case IJavaElement.JAVA_MODEL:
		case IJavaElement.JAVA_PROJECT:
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			// can be nested
			// (with exclusion
			// filters)
			return true;
		default:
			return false;
	}
}
 
Example 9
Source File: RefactoringExecutionStarter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private static RenameSupport createRenameSupport(IJavaElement element, String newName, int flags) throws CoreException {
	switch (element.getElementType()) {
		case IJavaElement.JAVA_PROJECT:
			return RenameSupport.create((IJavaProject) element, newName, flags);
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			return RenameSupport.create((IPackageFragmentRoot) element, newName);
		case IJavaElement.PACKAGE_FRAGMENT:
			return RenameSupport.create((IPackageFragment) element, newName, flags);
		case IJavaElement.COMPILATION_UNIT:
			return RenameSupport.create((ICompilationUnit) element, newName, flags);
		case IJavaElement.TYPE:
			return RenameSupport.create((IType) element, newName, flags);
		case IJavaElement.METHOD:
			final IMethod method= (IMethod) element;
			if (method.isConstructor())
				return createRenameSupport(method.getDeclaringType(), newName, flags);
			else
				return RenameSupport.create((IMethod) element, newName, flags);
		case IJavaElement.FIELD:
			return RenameSupport.create((IField) element, newName, flags);
		case IJavaElement.TYPE_PARAMETER:
			return RenameSupport.create((ITypeParameter) element, newName, flags);
		case IJavaElement.LOCAL_VARIABLE:
			return RenameSupport.create((ILocalVariable) element, newName, flags);
	}
	return null;
}
 
Example 10
Source File: DeleteChangeCreator.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
private static Change createDeleteChange(IJavaElement javaElement) throws JavaModelException {
	Assert.isTrue(! ReorgUtils.isInsideCompilationUnit(javaElement));

	switch(javaElement.getElementType()){
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			return createPackageFragmentRootDeleteChange((IPackageFragmentRoot)javaElement);

		case IJavaElement.PACKAGE_FRAGMENT:
			return createSourceManipulationDeleteChange((IPackageFragment)javaElement);

		case IJavaElement.COMPILATION_UNIT:
			return createSourceManipulationDeleteChange((ICompilationUnit)javaElement);

		case IJavaElement.CLASS_FILE:
			//if this assert fails, it means that a precondition is missing
			Assert.isTrue(((IClassFile)javaElement).getResource() instanceof IFile);
			return createDeleteChange(((IClassFile)javaElement).getResource());

		case IJavaElement.JAVA_MODEL: //cannot be done
			Assert.isTrue(false);
			return null;

		case IJavaElement.JAVA_PROJECT: //handled differently
			Assert.isTrue(false);
			return null;

		case IJavaElement.TYPE:
		case IJavaElement.FIELD:
		case IJavaElement.METHOD:
		case IJavaElement.INITIALIZER:
		case IJavaElement.PACKAGE_DECLARATION:
		case IJavaElement.IMPORT_CONTAINER:
		case IJavaElement.IMPORT_DECLARATION:
			Assert.isTrue(false);//not done here
			return new NullChange();
		default:
			Assert.isTrue(false);//there's no more kinds
			return new NullChange();
	}
}
 
Example 11
Source File: CleanUpAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private boolean isEnabled(IStructuredSelection selection) {
	Object[] selected= selection.toArray();
	for (int i= 0; i < selected.length; i++) {
		try {
			if (selected[i] instanceof IJavaElement) {
				IJavaElement elem= (IJavaElement)selected[i];
				if (elem.exists()) {
					switch (elem.getElementType()) {
						case IJavaElement.TYPE:
							return elem.getParent().getElementType() == IJavaElement.COMPILATION_UNIT; // for browsing perspective
						case IJavaElement.COMPILATION_UNIT:
							return true;
						case IJavaElement.IMPORT_CONTAINER:
							return true;
						case IJavaElement.PACKAGE_FRAGMENT:
						case IJavaElement.PACKAGE_FRAGMENT_ROOT:
							IPackageFragmentRoot root= (IPackageFragmentRoot)elem.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
							return (root.getKind() == IPackageFragmentRoot.K_SOURCE);
						case IJavaElement.JAVA_PROJECT:
							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=65638
							return true;
					}
				}
			} else if (selected[i] instanceof LogicalPackage) {
				return true;
			} else if (selected[i] instanceof IWorkingSet) {
				IWorkingSet workingSet= (IWorkingSet) selected[i];
				return IWorkingSetIDs.JAVA.equals(workingSet.getId());
			}
		} catch (JavaModelException e) {
			if (!e.isDoesNotExist()) {
				JavaPlugin.log(e);
			}
		}
	}
	return false;
}
 
Example 12
Source File: BuildpathIndicatorLabelDecorator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void processDelta(IJavaElementDelta delta, List<IJavaElement> result) {
	IJavaElement elem= delta.getElement();

	boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
	boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
	int flags= delta.getFlags();

	switch (elem.getElementType()) {
		case IJavaElement.JAVA_MODEL:
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.JAVA_PROJECT:
			if (isRemoved || (isChanged &&
					(flags & IJavaElementDelta.F_CLOSED) != 0)) {
				return;
			}
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (isRemoved) {
				return;
			}
			try {
				if ((((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) ||
						((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0))
						&& ((IPackageFragmentRoot)elem).getKind() != IPackageFragmentRoot.K_SOURCE) {
					result.add(elem);
				}
			} catch (JavaModelException e) {
				// don't update
			}
			return;
		default:
			return;
	}
}
 
Example 13
Source File: ContainerFilter.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public boolean select(Viewer viewer, Object parent, Object element) {
	boolean isContainer= element instanceof IContainer;
	if (!isContainer && element instanceof IJavaElement) {
		int type= ((IJavaElement)element).getElementType();
		isContainer= type == IJavaElement.JAVA_MODEL
					|| type == IJavaElement.JAVA_PROJECT
					|| type == IJavaElement.PACKAGE_FRAGMENT
					|| type ==IJavaElement.PACKAGE_FRAGMENT_ROOT;
	}
	return (fFilterContainers && !isContainer) || (!fFilterContainers && isContainer);
}
 
Example 14
Source File: JarFileExportOperation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Tells whether the given resource is an internal JAR.
 * 
 * @param resource the resource to test
 * @return <code>true</code> if it is an internal JAR, <code>false</code> otherwise
 * @since 3.6
 */
private boolean isInternalJar(IResource resource) {
	if (resource.getType() != IResource.FILE)
		return false;
	
	IJavaElement je= JavaCore.create(resource);
	if (je == null || je.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
		return false;
	
	IPackageFragmentRoot root= (IPackageFragmentRoot)je;
	return root.isArchive() && !root.isExternal();
}
 
Example 15
Source File: ReorgPolicyFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public RefactoringStatus initialize(JavaRefactoringArguments arguments) {
	final RefactoringStatus status= new RefactoringStatus();
	int rootCount= 0;
	String value= arguments.getAttribute(ATTRIBUTE_ROOTS);
	if (value != null && !"".equals(value)) {//$NON-NLS-1$
		try {
			rootCount= Integer.parseInt(value);
		} catch (NumberFormatException exception) {
			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_ROOTS));
		}
	} else
		return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_ROOTS));
	String handle= null;
	List<IJavaElement> elements= new ArrayList<IJavaElement>();
	for (int index= 0; index < rootCount; index++) {
		final String attribute= JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1);
		handle= arguments.getAttribute(attribute);
		if (handle != null && !"".equals(handle)) { //$NON-NLS-1$
			final IJavaElement element= JavaRefactoringDescriptorUtil.handleToElement(arguments.getProject(), handle, false);
			if (element == null || !element.exists() || element.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
				status.merge(JavaRefactoringDescriptorUtil.createInputWarningStatus(element, getProcessorId(), getRefactoringId()));
			else
				elements.add(element);
		} else
			return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, attribute));
	}
	fPackageFragmentRoots= elements.toArray(new IPackageFragmentRoot[elements.size()]);
	status.merge(super.initialize(arguments));
	return status;
}
 
Example 16
Source File: CopyModifications.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void copy(IJavaElement element, CopyArguments javaArgs, CopyArguments resourceArgs) throws CoreException {
	switch(element.getElementType()) {
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			copy((IPackageFragmentRoot)element, javaArgs, resourceArgs);
			break;
		case IJavaElement.PACKAGE_FRAGMENT:
			copy((IPackageFragment)element, javaArgs, resourceArgs);
			break;
		case IJavaElement.COMPILATION_UNIT:
			copy((ICompilationUnit)element, javaArgs, resourceArgs);
			break;
		default:
			add(element, javaArgs, null);
	}
}
 
Example 17
Source File: SourceAttachmentCommand.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
private static IPackageFragmentRoot getPackageFragmentRoot(IClassFile file) {
	IJavaElement element = file.getParent();
	while (element != null && element.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT) {
		element = element.getParent();
	}

	return (IPackageFragmentRoot) element;
}
 
Example 18
Source File: OpenTypeHistory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Computes whether the history needs a consistency check or not.
 *
 * @param delta the Java element delta
 *
 * @return <code>true</code> if consistency must be checked
 *  <code>false</code> otherwise.
 */
private boolean processDelta(IJavaElementDelta delta) {
	IJavaElement elem= delta.getElement();

	boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
	boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;

	switch (elem.getElementType()) {
		case IJavaElement.JAVA_PROJECT:
			if (isRemoved || (isChanged &&
					(delta.getFlags() & IJavaElementDelta.F_CLOSED) != 0)) {
				return true;
			}
			return processChildrenDelta(delta);
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (isRemoved || (isChanged && (
					(delta.getFlags() & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0 ||
					(delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0))) {
				return true;
			}
			return processChildrenDelta(delta);
		case IJavaElement.TYPE:
			if (isChanged && (delta.getFlags() & IJavaElementDelta.F_MODIFIERS) != 0) {
				return true;
			}
			if (isRemoved) {
				return true;
			}
			return processChildrenDelta(delta);
		case IJavaElement.JAVA_MODEL:
		case IJavaElement.PACKAGE_FRAGMENT:
		case IJavaElement.CLASS_FILE:
			if (isRemoved) {
				return true;
			}
			return processChildrenDelta(delta);
		case IJavaElement.COMPILATION_UNIT:
			// Not the primary compilation unit. Ignore it
			if (!JavaModelUtil.isPrimary((ICompilationUnit) elem)) {
				return false;
			}

			if (isRemoved || (isChanged && isUnknownStructuralChange(delta.getFlags()))) {
				return true;
			}
			return processChildrenDelta(delta);
		default:
			// fields, methods, imports ect
			return false;
	}
}
 
Example 19
Source File: InterfaceIndicatorLabelDecorator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void processDelta(IJavaElementDelta delta, List<IJavaElement> result) {
	IJavaElement elem= delta.getElement();

	boolean isChanged= delta.getKind() == IJavaElementDelta.CHANGED;
	boolean isRemoved= delta.getKind() == IJavaElementDelta.REMOVED;
	int flags= delta.getFlags();

	switch (elem.getElementType()) {
		case IJavaElement.JAVA_PROJECT:
			if (isRemoved || (isChanged &&
					(flags & IJavaElementDelta.F_CLOSED) != 0)) {
				return;
			}
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.PACKAGE_FRAGMENT_ROOT:
			if (isRemoved || (isChanged && (
					(flags & IJavaElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0 ||
					(flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0))) {
				return;
			}
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.PACKAGE_FRAGMENT:
			if (isRemoved)
				return;
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.TYPE:
		case IJavaElement.CLASS_FILE:
			return;
		case IJavaElement.JAVA_MODEL:
			processChildrenDelta(delta, result);
			return;
		case IJavaElement.COMPILATION_UNIT:
			// Not the primary compilation unit. Ignore it
			if (!JavaModelUtil.isPrimary((ICompilationUnit) elem)) {
				return;
			}

			if (isChanged &&  ((flags & IJavaElementDelta.F_CONTENT) != 0 || (flags & IJavaElementDelta.F_FINE_GRAINED) != 0)) {
				if (delta.getAffectedChildren().length == 0)
					return;

				result.add(elem);
			}
			return;
		default:
			// fields, methods, imports ect
			return;
	}
}
 
Example 20
Source File: MultiOrganizeImportsHandler.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
private void collectRelevantFiles(Object element, Multimap<IProject, IFile> result) {
	try {
		if (element instanceof IJavaElement) {
			IJavaElement elem = (IJavaElement) element;
			if (elem.exists()) {
				switch (elem.getElementType()) {
					case IJavaElement.PACKAGE_FRAGMENT:
						collectRelevantFiles((IPackageFragment) elem, result);
						break;
					case IJavaElement.PACKAGE_FRAGMENT_ROOT:
						collectRelevantFiles((IPackageFragmentRoot) elem, result);
						break;
					case IJavaElement.JAVA_PROJECT:
						IPackageFragmentRoot[] roots;
						roots = ((IJavaProject) elem).getPackageFragmentRoots();
						for (int k = 0; k < roots.length; k++) {
							collectRelevantFiles(roots[k], result);
						}
						break;
				}
			}
		} else if (element instanceof LogicalPackage) {
			IPackageFragment[] packageFragments = ((LogicalPackage) element).getFragments();
			for (int k = 0; k < packageFragments.length; k++) {
				IPackageFragment pack = packageFragments[k];
				if (pack.exists()) {
					collectRelevantFiles(pack, result);
				}
			}
		} else if (element instanceof IWorkingSet) {
			IWorkingSet workingSet = (IWorkingSet) element;
			IAdaptable[] elements = workingSet.getElements();
			for (int j = 0; j < elements.length; j++) {
				collectRelevantFiles(elements[j], result);
			}
		} else if (element instanceof IFile) {
			collectIFiles(result, new Object[] { element });
		}
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
}