Eclipse Platform
Release 3.1

org.eclipse.jface.commands
Class ActionHandler

java.lang.Object
  extended byorg.eclipse.core.commands.AbstractHandler
      extended byorg.eclipse.jface.commands.ActionHandler
All Implemented Interfaces:
IHandler

public final class ActionHandler
extends AbstractHandler

This class adapts instances of IAction to IHandler.

Since:
3.1

Constructor Summary
ActionHandler(IAction action)
          Creates a new instance of this class given an instance of IAction.
 
Method Summary
 void addHandlerListener(IHandlerListener handlerListener)
          Registers an instance of IHandlerListener to listen for changes to properties of this instance.
 void dispose()
          Removes the property change listener from the action.
 Object execute(ExecutionEvent event)
          Executes with the map of parameter values by name.
 IAction getAction()
          Returns the action associated with this handler
 boolean isEnabled()
          Whether this handler is capable of executing at this time.
 boolean isHandled()
          Whether this handler is capable of handling delegated responsibilities at this time.
 void removeHandlerListener(IHandlerListener handlerListener)
          Unregisters an instance of IHandlerListener listening for changes to properties of this instance.
 String toString()
           
 
Methods inherited from class org.eclipse.core.commands.AbstractHandler
fireHandlerChanged, hasListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionHandler

public ActionHandler(IAction action)
Creates a new instance of this class given an instance of IAction.

Parameters:
action - the action. Must not be null.
Method Detail

addHandlerListener

public final void addHandlerListener(IHandlerListener handlerListener)
Description copied from interface: IHandler
Registers an instance of IHandlerListener to listen for changes to properties of this instance.

Specified by:
addHandlerListener in interface IHandler
Overrides:
addHandlerListener in class AbstractHandler
See Also:
IHandler.addHandlerListener(IHandlerListener)

dispose

public final void dispose()
Removes the property change listener from the action.

Specified by:
dispose in interface IHandler
Overrides:
dispose in class AbstractHandler
See Also:
IHandler.dispose()

execute

public final 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.

getAction

public final IAction getAction()
Returns the action associated with this handler

Returns:
the action associated with this handler (not null)
Since:
3.1

isEnabled

public final boolean isEnabled()
Description copied from class: AbstractHandler
Whether this handler is capable of executing at this time. Subclasses may override this method.

Specified by:
isEnabled in interface IHandler
Overrides:
isEnabled in class AbstractHandler
Returns:
true

isHandled

public final boolean isHandled()
Description copied from class: AbstractHandler
Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.

Specified by:
isHandled in interface IHandler
Overrides:
isHandled in class AbstractHandler
Returns:
true

removeHandlerListener

public final void removeHandlerListener(IHandlerListener handlerListener)
Description copied from interface: IHandler
Unregisters an instance of IHandlerListener listening for changes to properties of this instance.

Specified by:
removeHandlerListener in interface IHandler
Overrides:
removeHandlerListener in class AbstractHandler
See Also:
IHandler.removeHandlerListener(IHandlerListener)

toString

public final String toString()

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.