public class FileBufferOperationHandler extends AbstractHandler
This class may be instantiated or be subclassed.
Constructor and Description |
---|
FileBufferOperationHandler(IFileBufferOperation fileBufferOperation)
Creates a new file buffer operation handler.
|
Modifier and Type | Method and Description |
---|---|
protected IFile[] |
collectFiles(IResource[] resources)
Collects the files out of the given resources.
|
protected void |
computeSelectedResources()
Computes the selected resources.
|
protected void |
doRun(IFile[] files,
IPath location,
IFileBufferOperation fileBufferOperation)
Runs the given operation.
|
Object |
execute(ExecutionEvent event)
Executes with the map of parameter values by name.
|
protected IPath[] |
generateLocations(IFile[] files,
IProgressMonitor progressMonitor)
Generates the file buffer locations out of the given files.
|
protected ISelection |
getSelection()
Returns the selection of the active workbench window.
|
protected Shell |
getShell()
Returns the shell of the active workbench window.
|
protected IWorkbenchWindow |
getWorkbenchWindow()
Returns the active workbench window.
|
void |
initialize(IResource[] resources,
IPath location)
Initializes this file buffer operation handler with the given resources and the given location.
|
protected boolean |
isAcceptableLocation(IPath location)
Tells whether the given location is accepted by this handler.
|
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public FileBufferOperationHandler(IFileBufferOperation fileBufferOperation)
fileBufferOperation
- the file buffer operationpublic void initialize(IResource[] resources, IPath location)
resources
- the resources to be adoptedlocation
- the locationprotected final void computeSelectedResources()
protected final ISelection getSelection()
null
protected final IWorkbenchWindow getWorkbenchWindow()
null
if not availableprotected IFile[] collectFiles(IResource[] resources)
resources
- the resources from which to get the filesprotected final void doRun(IFile[] files, IPath location, IFileBufferOperation fileBufferOperation)
files
- the file on which to run this operationlocation
- the file buffer locationfileBufferOperation
- the operation to runprotected final Shell getShell()
protected final IPath[] generateLocations(IFile[] files, IProgressMonitor progressMonitor)
files
- an array of filesprogressMonitor
- the progress monitorprotected boolean isAcceptableLocation(IPath location)
location
- a file buffer locationtrue
if the given location is acceptablepublic Object execute(ExecutionEvent event) throws ExecutionException
IHandler
event
- An event containing all the information about the current
state of the application; must not be null
.null
.ExecutionException
- if an exception occurred during execution.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.