Package org.eclipse.ui.editors.text
Class FileBufferOperationHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.ui.editors.text.FileBufferOperationHandler
Operation handler for a file buffer.
This class may be instantiated or be subclassed.
- Since:
- 3.1
-
Constructor Summary
ConstructorDescriptionFileBufferOperationHandler
(IFileBufferOperation fileBufferOperation) Creates a new file buffer operation handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected IFile[]
collectFiles
(IResource[] resources) Collects the files out of the given resources.protected final void
Computes the selected resources.protected final void
doRun
(IFile[] files, IPath location, IFileBufferOperation fileBufferOperation) Runs the given operation.execute
(ExecutionEvent event) Executes with the map of parameter values by name.protected final IPath[]
generateLocations
(IFile[] files, IProgressMonitor progressMonitor) Generates the file buffer locations out of the given files.protected final ISelection
Returns the selection of the active workbench window.protected final Shell
getShell()
Returns the shell of the active workbench window.protected final IWorkbenchWindow
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.Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
FileBufferOperationHandler
Creates a new file buffer operation handler.- Parameters:
fileBufferOperation
- the file buffer operation
-
-
Method Details
-
initialize
Initializes this file buffer operation handler with the given resources and the given location. The array of resources is adopted by this handler and may not be modified by clients after that method has been called.- Parameters:
resources
- the resources to be adoptedlocation
- the location
-
computeSelectedResources
protected final void computeSelectedResources()Computes the selected resources. -
getSelection
Returns the selection of the active workbench window.- Returns:
- the current selection in the active workbench window or
null
-
getWorkbenchWindow
Returns the active workbench window.- Returns:
- the active workbench window or
null
if not available
-
collectFiles
Collects the files out of the given resources.- Parameters:
resources
- the resources from which to get the files- Returns:
- an array of files
-
doRun
Runs the given operation.- Parameters:
files
- the file on which to run this operationlocation
- the file buffer locationfileBufferOperation
- the operation to run
-
getShell
Returns the shell of the active workbench window.- Returns:
- the shell
-
generateLocations
Generates the file buffer locations out of the given files.- Parameters:
files
- an array of filesprogressMonitor
- the progress monitor- Returns:
- an array with the generated locations
-
isAcceptableLocation
Tells whether the given location is accepted by this handler.- Parameters:
location
- a file buffer location- Returns:
true
if the given location is acceptable
-
execute
Description copied from interface:IHandler
Executes with the map of parameter values by name.- Parameters:
event
- An event containing all the information about the current state of the application; must not benull
.- Returns:
- the result of the execution. Reserved for future use, must be
null
. - Throws:
ExecutionException
- if an exception occurred during execution.
-