|
||||||||||
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.State
public class State
A piece of state information that can be shared between objects, and might be persisted between sessions. This can be used for commands that toggle between two states and wish to pass this state information between different handlers.
This state object can either be used as a single state object shared between several commands, or one state object per command -- depending on the needs of the application.
Clients may instantiate or extend this class.
Constructor Summary | |
---|---|
State()
|
Method Summary | |
---|---|
void |
addListener(IStateListener listener)
Adds a listener to changes for this state. |
void |
dispose()
Disposes of this state. |
protected void |
fireStateChanged(java.lang.Object oldValue)
Notifies listeners to this state that it has changed in some way. |
java.lang.String |
getId()
Returns the identifier for this state. |
java.lang.Object |
getValue()
The current value associated with this state. |
void |
removeListener(IStateListener listener)
Removes a listener to changes from this state. |
void |
setId(java.lang.String id)
Sets the identifier for this object. |
void |
setValue(java.lang.Object value)
Sets the value for this state object. |
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 |
Constructor Detail |
---|
public State()
Method Detail |
---|
public void addListener(IStateListener listener)
listener
- The listener to add; must not be null
.public void dispose()
protected final void fireStateChanged(java.lang.Object oldValue)
oldValue
- The old value; may be anything.public final java.lang.String getId()
null
.public java.lang.Object getValue()
public void removeListener(IStateListener listener)
listener
- The listener to remove; must not be null
.public void setId(java.lang.String id)
id
- The id; must not be null
.public void setValue(java.lang.Object value)
value
- The value to set; may be anything.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |