|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.core.commands.AbstractHandlerWithState
* An abstract implementation of IObjectWithState
. This provides basic
* handling for adding and remove state. When state is added, the handler
* attaches itself as a listener and fire a handleStateChange event to notify
* this handler. When state is removed, the handler removes itself as a
* listener.
*
* Clients may extend this class. *
* * @since 3.2
Constructor Summary | |
---|---|
AbstractHandlerWithState()
|
Method Summary | |
---|---|
void |
addState(String stateId,
State state)
* Adds a state to this handler. |
State |
getState(String stateId)
Gets the state with the given id. |
String[] |
getStateIds()
Gets the identifiers for all of the state associated with this object. |
void |
removeState(String stateId)
* Removes a state from this handler. |
Methods inherited from class org.eclipse.core.commands.AbstractHandler |
---|
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener |
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 |
Methods inherited from interface org.eclipse.core.commands.IStateListener |
---|
handleStateChange |
Methods inherited from interface org.eclipse.core.commands.IHandler |
---|
execute |
Constructor Detail |
public AbstractHandlerWithState()
Method Detail |
public void addState(String stateId, State state)
* Adds a state to this handler. This will add this handler as a listener to * the state, and then fire a handleStateChange so that the handler can * respond to the incoming state. *
** Clients may extend this method, but they should call this super method * first before doing anything else. *
* * @param stateId * The identifier indicating the type of state being added; must * not benull
.
* @param state
* The state to add; must not be null
.
addState
in interface IObjectWithState
stateId
- The identifier indicating the type of state being added; must
not be null
.state
- The new state to add to this object; must not be
null
.public final State getState(String stateId)
IObjectWithState
getState
in interface IObjectWithState
stateId
- The identifier of the state to retrieve; must not be
null
.
null
if there is no state with
the given id.public final String[] getStateIds()
IObjectWithState
getStateIds
in interface IObjectWithState
null
.public void removeState(String stateId)
* Removes a state from this handler. This will remove this handler as a * listener to the state. No event is fired to notify the handler of this * change. *
** Clients may extend this method, but they should call this super method * first before doing anything else. *
* * @param stateId * The identifier of the state to remove; must not be *null
.
removeState
in interface IObjectWithState
stateId
- The id of the state to remove from this object; must not be
null
.
|
Eclipse Platform Release 3.2 |
|||||||||||
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, 2006. All rights reserved.