Java源码示例:org.eclipse.ui.wizards.datatransfer.IImportStructureProvider

示例1
/**
 * Return a list of all files in the project
 * 
 * @param files
 * @param provider
 *            The provider for the parent file
 * @param entry
 *            The root directory of the project
 * @return A list of all files in the project
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
protected boolean getFilesForProject(Collection files, IImportStructureProvider provider, Object entry)
{
	List children = provider.getChildren(entry);
	Iterator childrenEnum = children.iterator();

	while (childrenEnum.hasNext())
	{
		Object child = childrenEnum.next();
		// Add the child, this way we get every files except the project
		// folder itself which we don't want
		files.add(child);
		// We don't have isDirectory for tar so must check for children
		// instead
		if (provider.isFolder(child))
		{
			getFilesForProject(files, provider, child);
		}
	}
	return true;
}
 
示例2
/**
 * Constructor
 *
 * @param importStructureProvider
 *            the {@link IImportStructureProvider}
 * @param archivePath
 *            the path of the archive file
 */
public FileSystemObjectImportStructureProvider(IImportStructureProvider importStructureProvider, String archivePath) {
    fImportProvider = importStructureProvider;
    fArchivePath = archivePath;
}