Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2005 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.ant.internal.ui.debug;
public class AntSourceContainer extends AbstractSourceContainer {
	public AntSourceContainer() {
		 = ResourcesPlugin.getWorkspace().getRoot();
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
	 */
	public Object[] findSourceElements(String paththrows CoreException {
		ArrayList sources = new ArrayList();
		File osFile = new File(path);
		if (osFile.exists()) {
			try {
				IPath canonicalPath = new Path(osFile.getCanonicalPath());
				IFile[] files = .findFilesForLocation(canonicalPath);
				if (files.length > 0) {
					for (int i = 0; i < files.lengthi++) {
						sources.add(files[i]);
					}
else {
					sources.add(new LocalFileStorage(osFile));
				}
catch (IOException e) {
			}
		}
		return sources.toArray();
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
	 */
	public String getName() {
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
     * Not persisted via the launch configuration
	 */
		return null;
	}
New to GrepCode? Check out our FAQ X