|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.scopemvc.core.Control
A token passed up the chain of Controllers to invoke a piece of presentation
logic. Controllers match against the ID of a Control passed into handleControl
If the ID is
recognised then the Controller can execute some presentation logic. If the
Control ID is not recognised, the Control should be sent back on its journey
up the chain of responsibility by passing it to the parent Controller. See
Controller.handleControl()
and BasicController.passControlToParent()
.
Controls are received by a Controller from either a View or a child Controller.
Controls can optionally contain an Object parameter: see getParameter()
The Control ID is used by Controllers to recognise a Control and also as a
key to the user-readable version of the the Control's name in UIStrings
presented to the user by the default
error-handling mechanism in BasicController
.
View
,
Controller
Constructor Summary | |
Control(java.lang.String inID)
Create a Control with a unique String ID and no parameter. |
|
Control(java.lang.String inID,
java.lang.Object inParameter)
Create a Control with a unique String ID and a parameter. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Tests for equality |
java.lang.String |
getName()
Deprecated. use matchesID(java.lang.String) not this method which will be removed
at some point. |
java.lang.Object |
getParameter()
Get the parameter for the Control |
int |
hashCode()
Returns the hashCode |
boolean |
isMatched()
Has this Control been matched by a Controller yet? |
void |
markMatched()
Mark the Control as matched. |
void |
markUnmatched()
Mark the Control as unmatched. |
boolean |
matchesID(java.lang.String inID)
Tests if this Control matches the given ID. |
void |
populateControlException(ControlException inException)
For use by a ControlException handler only, not for application writers. |
void |
setParameter(java.lang.Object inParameter)
Set a parameter for the Control |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Control(java.lang.String inID)
inID
- The unique ID identifying the Controlpublic Control(java.lang.String inID, java.lang.Object inParameter)
inID
- The unique ID identifying the ControlinParameter
- A parameter for the ControlMethod Detail |
public final java.lang.String getName()
matchesID(java.lang.String)
not this method which will be removed
at some point.
matchesID(java.lang.String)
not this method.
public final boolean isMatched()
public final java.lang.Object getParameter()
public final void setParameter(java.lang.Object inParameter)
inParameter
- The new parameter valuepublic final void markUnmatched()
public final void markMatched()
public final boolean matchesID(java.lang.String inID)
inID
- The ID to test against
public void populateControlException(ControlException inException)
inException
- exception to populate with info from this Control.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj argument;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |