Package 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
-
- Direct Known Subclasses:
ActionHandler
@Deprecated public abstract class AbstractHandler extends AbstractHandler implements IHandler
Deprecated.Please use the "org.eclipse.core.commands" plug-in instead. This API is scheduled for deletion, see Bug 431177 for detailsThis class is a partial implementation ofIHandler
. 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 callfireHandlerChanged(HandlerEvent)
when the handler changes. Subclasses should also overridegetAttributeValuesByName()
if they have any attributes.- Since:
- 3.0
- See Also:
AbstractHandler
- Restriction:
- This class is not intended to be extended by clients.
- Restriction:
- This class is scheduled for deletion.
-
-
Constructor Summary
Constructors Constructor Description AbstractHandler()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addHandlerListener(IHandlerListener handlerListener)
Deprecated.void
dispose()
Deprecated.Object
execute(ExecutionEvent event)
Deprecated.protected void
fireHandlerChanged(HandlerEvent handlerEvent)
Deprecated.protected void
fireHandlerChanged(HandlerEvent handlerEvent)
Deprecated.Map
getAttributeValuesByName()
Deprecated.protected boolean
hasListeners()
Deprecated.boolean
isEnabled()
Deprecated.boolean
isHandled()
Deprecated.void
removeHandlerListener(IHandlerListener handlerListener)
Deprecated.-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, removeHandlerListener, setBaseEnabled, setEnabled
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Method Detail
-
addHandlerListener
@Deprecated public void addHandlerListener(IHandlerListener handlerListener)
Deprecated.Description copied from interface:IHandler
Registers an instance ofIHandlerListener
to listen for changes to properties of this instance.- Specified by:
addHandlerListener
in interfaceIHandler
- Parameters:
handlerListener
- the instance to register. Must not benull
. 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
@Deprecated 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 interfaceIHandler
- Specified by:
dispose
in interfaceIHandler
- Overrides:
dispose
in classAbstractHandler
- See Also:
IHandler.dispose()
-
execute
@Deprecated 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 interfaceIHandler
- 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.
-
fireHandlerChanged
@Deprecated protected void fireHandlerChanged(HandlerEvent handlerEvent)
Deprecated.Fires an event to all registered listeners describing changes to this instance.- Overrides:
fireHandlerChanged
in classAbstractHandler
- Parameters:
handlerEvent
- the event describing changes to this instance. Must not benull
.
-
fireHandlerChanged
@Deprecated protected void fireHandlerChanged(HandlerEvent handlerEvent)
Deprecated.- See Also:
AbstractHandler
-
getAttributeValuesByName
@Deprecated public Map getAttributeValuesByName()
Deprecated.This simply return an empty map. The default implementation has no attributes.- Specified by:
getAttributeValuesByName
in interfaceIHandler
- 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 ofString
. - See Also:
IHandler.getAttributeValuesByName()
-
hasListeners
@Deprecated protected final boolean hasListeners()
Deprecated.Returns true iff there is one or more IHandlerListeners attached to this AbstractHandler.- Overrides:
hasListeners
in classAbstractHandler
- Returns:
- true iff there is one or more IHandlerListeners attached to this AbstractHandler
- Since:
- 3.1
-
isEnabled
@Deprecated 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 overridingAbstractHandler.setEnabled(Object)
so they can be notified about framework execution contexts.- Specified by:
isEnabled
in interfaceIHandler
- Overrides:
isEnabled
in classAbstractHandler
- Returns:
true
- See Also:
AbstractHandler.setEnabled(Object)
,AbstractHandler.setBaseEnabled(boolean)
-
isHandled
@Deprecated 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 interfaceIHandler
- Overrides:
isHandled
in classAbstractHandler
- Returns:
true
-
removeHandlerListener
@Deprecated public void removeHandlerListener(IHandlerListener handlerListener)
Deprecated.Description copied from interface:IHandler
Unregisters an instance ofIPropertyListener
listening for changes to properties of this instance.- Specified by:
removeHandlerListener
in interfaceIHandler
- Parameters:
handlerListener
- the instance to unregister. Must not benull
. 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)
-
-