public class SelectFilesOperation extends Object implements IRunnableWithProgress
Constructor and Description |
---|
SelectFilesOperation(Object rootObject,
IImportStructureProvider structureProvider)
Creates a new
SelectFilesOperation . |
Modifier and Type | Method and Description |
---|---|
protected FileSystemElement |
createElement(FileSystemElement parent,
Object fileSystemObject)
Creates and returns a
FileSystemElement if the specified
file system object merits one. |
protected String |
getExtensionFor(String filename)
Returns the extension portion of the passed filename string.
|
FileSystemElement |
getResult()
Returns the resulting root file system element.
|
protected boolean |
hasDesiredExtension(String filename)
Returns a boolean indicating whether the extension of the passed filename
is one of the extensions specified as desired by the filter.
|
void |
run(IProgressMonitor monitor)
Runs the operation.
|
void |
setDesiredExtensions(String[] extensions)
Sets the file extensions which are desired.
|
public SelectFilesOperation(Object rootObject, IImportStructureProvider structureProvider)
SelectFilesOperation
.protected FileSystemElement createElement(FileSystemElement parent, Object fileSystemObject) throws InterruptedException
FileSystemElement
if the specified
file system object merits one. The criteria for this are:
- if the file system object is a container then it must have either a
child container or an associated file
- if the file system object is a file then it must have an extension
suitable for selectionInterruptedException
protected String getExtensionFor(String filename)
public FileSystemElement getResult()
protected boolean hasDesiredExtension(String filename)
public void run(IProgressMonitor monitor) throws InterruptedException
run
in interface IRunnableWithProgress
monitor
- the progress monitor to use to display progress and receive
requests for cancelationInterruptedException
- if the operation detects a request to cancel,
using IProgressMonitor.isCanceled()
, it should exit by throwing
InterruptedException
IRunnableContext.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
public void setDesiredExtensions(String[] extensions)
null
indicates that all files should be kept regardless of extension.
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.