|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.AbstractHandler
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 can also override isEnabled()
and
isHandled()
.
Constructor Summary | |
---|---|
AbstractHandler()
|
Method Summary | |
---|---|
void |
addHandlerListener(IHandlerListener handlerListener)
Registers an instance of IHandlerListener to listen for
changes to properties of this instance. |
void |
dispose()
The default implementation does nothing. |
protected void |
fireHandlerChanged(HandlerEvent handlerEvent)
Fires an event to all registered listeners describing changes to this instance. |
protected boolean |
hasListeners()
Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.core.commands.IHandler |
---|
execute |
Constructor Detail |
public AbstractHandler()
Method Detail |
public void addHandlerListener(IHandlerListener handlerListener)
IHandler
IHandlerListener
to listen for
changes to properties of this instance.
addHandlerListener
in interface IHandler
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.IHandler.addHandlerListener(IHandlerListener)
public void dispose()
dispose
in interface IHandler
IHandler.dispose()
protected void fireHandlerChanged(HandlerEvent handlerEvent)
Subclasses may extend the definition of this method (i.e., if a different
type of listener can be attached to a subclass). This is used primarily
for support of AbstractHandler
in
org.eclipse.ui.workbench
, and clients should be wary of
overriding this behaviour. If this method is overridden, then the first
line of the method should be "super.fireHandlerChanged(handlerEvent);
".
handlerEvent
- the event describing changes to this instance. Must not be
null
.public boolean isEnabled()
isEnabled
in interface IHandler
true
public boolean isHandled()
isHandled
in interface IHandler
true
protected boolean hasListeners()
Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler.
Subclasses may extend the definition of this method (i.e., if a different
type of listener can be attached to a subclass). This is used primarily
for support of AbstractHandler
in
org.eclipse.ui.workbench
, and clients should be wary of
overriding this behaviour. If this method is overridden, then the return
value should include "super.hasListeners() ||
".
public void removeHandlerListener(IHandlerListener handlerListener)
IHandler
IHandlerListener
listening for
changes to properties of this instance.
removeHandlerListener
in interface IHandler
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.IHandler.removeHandlerListener(IHandlerListener)
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.