org.eclipse.ui.commands
Class AbstractHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.ui.commands.AbstractHandler
-
All Implemented Interfaces:
-
IHandler,
IHandler2
-
Direct Known Subclasses:
-
ActionHandler
Deprecated. Please use the "org.eclipse.core.commands" plug-in instead.
-
public abstract class AbstractHandler
- extends
AbstractHandler
- implements
IHandler
This class is a partial implementation of IHandler
. This
abstract implementation provides support for handler listeners. You should
subclass from this method unless you want to implement your own listener
support. Subclasses should call
fireHandlerChanged(HandlerEvent)
when the handler
changes. Subclasses should also override
getAttributeValuesByName()
if they have any
attributes.
-
Since:
- 3.0
-
See Also:
-
AbstractHandler
Method Summary
|
void
|
addHandlerListener
(
IHandlerListener handlerListener)
Deprecated. Registers an instance of IHandlerListener to listen for
changes to properties of this instance. |
void
|
dispose
()
Deprecated. The default implementation does nothing. |
Object
|
execute
(
ExecutionEvent event)
Deprecated. Executes with the map of parameter values by name. |
protected void
|
fireHandlerChanged
(
HandlerEvent handlerEvent)
Deprecated. Fires an event to all registered listeners describing changes to this
instance. |
protected void
|
fireHandlerChanged
(
HandlerEvent handlerEvent)
Deprecated. |
Map
|
getAttributeValuesByName
()
Deprecated. This simply return an empty map. |
protected boolean
|
hasListeners
()
Deprecated. Returns true iff there is one or more IHandlerListeners attached to this
AbstractHandler. |
boolean
|
isEnabled
()
Deprecated. Whether this handler is capable of executing at this time. |
boolean
|
isHandled
()
Deprecated. Whether this handler is capable of handling delegated responsibilities at
this time. |
void
|
removeHandlerListener
(
IHandlerListener handlerListener)
Deprecated. Unregisters an instance of IPropertyListener listening for
changes to properties of this instance. |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
AbstractHandler
public AbstractHandler()
-
Deprecated.
addHandlerListener
public void addHandlerListener(
IHandlerListener handlerListener)
-
Deprecated.
-
Description copied from interface:
IHandler
- Registers an instance of
IHandlerListener
to listen for
changes to properties of this instance.
-
-
-
Parameters:
-
handlerListener
- the instance to register. Must not be null
. If
an attempt is made to register an instance which is already
registered with this instance, no operation is performed. -
See Also:
-
IHandler.addHandlerListener(IHandlerListener)
dispose
public void dispose()
-
Deprecated.
- The default implementation does nothing. Subclasses who attach listeners
to other objects are encouraged to detach them in this method.
-
-
Specified by:
-
dispose
in interface
IHandler
-
Overrides:
-
dispose
in class
AbstractHandler
-
-
See Also:
-
IHandler.dispose()
execute
public
Object execute(
ExecutionEvent event)
throws
ExecutionException
-
Deprecated.
-
Description copied from interface:
IHandler
- Executes with the map of parameter values by name.
-
-
Specified by:
-
execute
in interface
IHandler
-
-
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.
fireHandlerChanged
protected void fireHandlerChanged(
HandlerEvent handlerEvent)
-
Deprecated.
- Fires an event to all registered listeners describing changes to this
instance.
-
-
Overrides:
-
fireHandlerChanged
in class
AbstractHandler
-
-
Parameters:
-
handlerEvent
- the event describing changes to this instance. Must not be
null
.
fireHandlerChanged
protected void fireHandlerChanged(
HandlerEvent handlerEvent)
-
Deprecated.
-
-
getAttributeValuesByName
public
Map getAttributeValuesByName()
-
Deprecated.
- This simply return an empty map. The default implementation has no
attributes.
-
-
-
Returns:
- the map of attribute values by name. This map may be empty, but
is guaranteed not to be
null
. If this map is not
empty, its collection of keys is guaranteed to only contain
instances of String
. -
See Also:
-
IHandler.getAttributeValuesByName()
hasListeners
protected final boolean hasListeners()
-
Deprecated.
- Returns true iff there is one or more IHandlerListeners attached to this
AbstractHandler.
-
-
Overrides:
-
hasListeners
in class
AbstractHandler
-
-
Returns:
- true iff there is one or more IHandlerListeners attached to this
AbstractHandler
-
Since:
- 3.1
isEnabled
public boolean isEnabled()
-
Deprecated.
-
Description copied from class:
AbstractHandler
- Whether this handler is capable of executing at this time. Subclasses may
override this method. If clients override this method they should also
consider overriding
AbstractHandler.setEnabled(Object)
so they can be notified
about framework execution contexts.
-
-
Specified by:
-
isEnabled
in interface
IHandler
-
Overrides:
-
isEnabled
in class
AbstractHandler
-
-
Returns:
-
true
-
See Also:
-
AbstractHandler.setEnabled(Object)
,
AbstractHandler.setBaseEnabled(boolean)
isHandled
public boolean isHandled()
-
Deprecated.
-
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 void removeHandlerListener(
IHandlerListener handlerListener)
-
Deprecated.
-
Description copied from interface:
IHandler
- Unregisters an instance of
IPropertyListener
listening for
changes to properties of this instance.
-
-
-
Parameters:
-
handlerListener
- the instance to unregister. Must not be null
.
If an attempt is made to unregister an instance which is not
already registered with this instance, no operation is
performed. -
See Also:
-
IHandler.removeHandlerListener(IHandlerListener)
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.