|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.ip2.ItemHandler ix.ip2.ActivityHandler ix.ip2.ExpandHandler
public class ExpandHandler
Adds expansion actions to activities based on refinements in the agent's domain.
Nested Class Summary | |
---|---|
class |
ExpandHandler.ExpandAction
Handles an activity by expanding it into subactivities as specified by a refinement schema. |
protected class |
ExpandHandler.ItemListener
|
Field Summary | |
---|---|
protected Agenda |
actAgenda
|
protected Ip2 |
ip2
|
protected Ip2ModelManager |
modelManager
|
Fields inherited from class ix.ip2.ItemHandler |
---|
actionDescription |
Constructor Summary | |
---|---|
ExpandHandler(Ip2 ip2)
|
Method Summary | |
---|---|
void |
addHandlerActions(AgendaItem item)
Called to add any HandlerAction s that this
handler regards as appropriate for the specified AgendaItem. |
boolean |
appliesTo(AgendaItem item)
Gives this handler a say in whether it should add actions to an item. |
protected ExpandHandler.ExpandAction |
makeExpandAction(AgendaItem item,
Refinement r,
MatchEnv env)
Factory method that returns an instance of a suitable subclass of ExpandHandler.ExpandAction . |
HandlerAction |
makeManualExpandAction(AgendaItem item,
Refinement r)
|
protected MatchEnv |
matchRefinement(AgendaItem item,
Refinement r)
|
void |
refinementAdded(RefinementEvent event)
|
void |
reviseHandlerActions(AgendaItem item,
java.lang.Object reason)
Called after something has happened that may require new HandlerActions to be added to an item. |
Methods inherited from class ix.ip2.ActivityHandler |
---|
toString |
Methods inherited from class ix.ip2.ItemHandler |
---|
getActionDescription, getSyntaxList, handle, isAutomatic, makeHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Ip2 ip2
protected Agenda actAgenda
protected Ip2ModelManager modelManager
Constructor Detail |
---|
public ExpandHandler(Ip2 ip2)
Method Detail |
---|
public boolean appliesTo(AgendaItem item)
ItemHandler
appliesTo
in class ItemHandler
AgendaItem.wantsActionsFrom(ItemHandler handler)
public void addHandlerActions(AgendaItem item)
ItemHandler
HandlerAction
s that this
handler regards as appropriate for the specified AgendaItem.
This method is called only if both this handler's
ItemHandler.appliesTo(AgendaItem)
and the specified item's
AgendaItem.wantsActionsFrom(ItemHandler)
methods
return true.
The method provided by the ItemHandler class just adds
an action that calls this handler's ItemHandler.handle(AgendaItem)
method. This allows suitably simple handlers to avoid
working directly with HandlerActions.
Note that actions are added by calling an item's
AgendaItem.addAction(HandlerAction)
method.
addHandlerActions
in class ItemHandler
protected ExpandHandler.ExpandAction makeExpandAction(AgendaItem item, Refinement r, MatchEnv env)
ExpandHandler.ExpandAction
.
item
- the AgendaItem that would be expandedr
- the Refinement that would be used to expand itenv
- the result of matching the Refinement's pattern
against the item'sprotected MatchEnv matchRefinement(AgendaItem item, Refinement r)
public void refinementAdded(RefinementEvent event)
refinementAdded
in interface DomainListener
public void reviseHandlerActions(AgendaItem item, java.lang.Object reason)
ItemHandler
The reviseHandlerActions method is very similar to
the ItemHandler.addHandlerActions(AgendaItem)
method in
terms of its function and the applicability conditions
on when it is called. The main difference is that it
is called to look at AgendaItems that are not having
actions added for the first time and that may already
have an appropriate action, so that no new one needs
to be added.
Note that the usual way for an ItemHandler to get
HandlerActions removed is for it to call the controller's
checkActionValidity method. That results in calls to
HandlerAction.isStillValid()
methods.
reviseHandlerActions
in class ItemHandler
PanelController.reconsiderHandler(ItemHandler handler,
Object reason)
,
PanelController.checkActionValidity(ItemHandler handler,
Object reason)
public HandlerAction makeManualExpandAction(AgendaItem item, Refinement r)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |