Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.editors.text
Class FileBufferOperationHandler


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.core.commands.AbstractHandler
          extended by 
org.eclipse.ui.editors.text.FileBufferOperationHandler
All Implemented Interfaces:
IHandler, IHandler2

public class FileBufferOperationHandler
extends AbstractHandler

Operation handler for a file buffer.

This class may be instantiated or be subclassed.

Since:
3.1

Constructor Summary
FileBufferOperationHandler ( IFileBufferOperation fileBufferOperation)
          Creates a new file buffer operation handler.
 
Method Summary
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.
 
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
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBufferOperationHandler

public FileBufferOperationHandler(
IFileBufferOperation fileBufferOperation)
Creates a new file buffer operation handler.

Parameters:
fileBufferOperation - the file buffer operation
Method Detail

initialize

public void initialize(
IResource[] resources,
                       
IPath location)
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 adopted
location - the location

computeSelectedResources

protected final void computeSelectedResources()
Computes the selected resources.


getSelection

protected final 
ISelection getSelection()
Returns the selection of the active workbench window.

Returns:
the current selection in the active workbench window or null

getWorkbenchWindow

protected final 
IWorkbenchWindow getWorkbenchWindow()
Returns the active workbench window.

Returns:
the active workbench window or null if not available

collectFiles

protected 
IFile[] collectFiles(
IResource[] resources)
Collects the files out of the given resources.

Parameters:
resources - the resources from which to get the files
Returns:
an array of files

doRun

protected final void doRun(
IFile[] files,
                           
IPath location,
                           
IFileBufferOperation fileBufferOperation)
Runs the given operation.

Parameters:
files - the file on which to run this operation
location - the file buffer location
fileBufferOperation - the operation to run

getShell

protected final 
Shell getShell()
Returns the shell of the active workbench window.

Returns:
the shell

generateLocations

protected final 
IPath[] generateLocations(
IFile[] files,
                                          
IProgressMonitor progressMonitor)
Generates the file buffer locations out of the given files.

Parameters:
files - an array of files
progressMonitor - the progress monitor
Returns:
an array with the generated locations

isAcceptableLocation

protected boolean isAcceptableLocation(
IPath location)
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

public 
Object execute(
ExecutionEvent event)
               throws 
ExecutionException
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 be null.
Returns:
the result of the execution. Reserved for future use, must be null.
Throws:
ExecutionException - if an exception occurred during execution.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire