|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A - type of boxed actionpublic interface ActionFactory<A extends MyAbstractAction>
Action factory using the ActionConfig-like annotations to configure actions.
ActionFactory builds actions always on a same type A and obtain them from some
ActionProvider via methods newAction(String, JComponent) and newAction(String) .
If the action coming from the provider is not on the same type A, then the action is boxed in a *
action A and use the generic mecanism of delegation provided by MyAbstractAction.
Use after the loadActions(jaxx.runtime.JAXXObject) to instanciate actions in ui with id equals a known
action...
All actions instanciated are stored in a cache that you can request via method getActionFromCache(String),
cacheEntrySet() and resetCache().
You can also from this factory fires some action via the methods fireAction(String, Object, JComponent) ,
fireAction(String, Object) , fireAction0(String, Object, MyAbstractAction).
Finally, a dispose() method is there to shut down all instanciated action when you want to dispose all uis.
ActionProvider,
MyAbstractAction| Method Summary | |
|---|---|
java.util.Set<java.util.Map.Entry<java.lang.String,A>> |
cacheEntrySet()
|
void |
dispose()
dispose all actions in cache using MyAbstractAction.disposeUI() on each
action, then resetCache() |
void |
fireAction(java.lang.String actionKey,
java.lang.Object source)
Fire an action given his key and his source, no widget are involved here |
void |
fireAction(java.lang.String actionKey,
java.lang.Object source,
javax.swing.JComponent component)
Fire an action given his key, his source and tthe widget responsible of action |
void |
fireAction0(java.lang.String actionKey,
java.lang.Object source,
A action)
Fire an action given his action's key, his source and the real action. |
MyAbstractAction |
getActionFromCache(java.lang.String actionKey)
|
java.lang.String[] |
getActionNames()
|
java.lang.Class<A> |
getBaseClass()
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Class<? extends MyAbstractAction>>> |
implsEntrySet()
|
java.util.Map<java.lang.String,java.lang.Class<? extends MyAbstractAction>> |
init()
Method to init the dictionary of knwon action implementations. |
void |
loadActions(JAXXObject ui)
For a given ui, load all actions registred in factory. |
A |
newAction(java.lang.String actionKey)
Obtain an action instance given his key (should call newAction(String, JComponent)
This is a convinient method when you want to obtain an action with no attached widget. |
A |
newAction(java.lang.String actionKey,
javax.swing.JComponent component)
Obtain an action instance given his key and widget |
void |
resetCache()
clear the cache of instanciated actions. |
| Method Detail |
|---|
java.util.Map<java.lang.String,java.lang.Class<? extends MyAbstractAction>> init()
java.lang.Class<A> getBaseClass()
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Class<? extends MyAbstractAction>>> implsEntrySet()
java.lang.String[] getActionNames()
java.util.Set<java.util.Map.Entry<java.lang.String,A>> cacheEntrySet()
MyAbstractAction getActionFromCache(java.lang.String actionKey)
actionKey - the action's key
null if action is not in cachevoid resetCache()
void loadActions(JAXXObject ui)
ui - the ui to treate
A newAction(java.lang.String actionKey,
javax.swing.JComponent component)
actionKey - the key of actioncomponent - the component using the action
getActionFromCache(String)A newAction(java.lang.String actionKey)
newAction(String, JComponent)
This is a convinient method when you want to obtain an action with no attached widget.
actionKey - the key of action
getActionFromCache(String)
void fireAction(java.lang.String actionKey,
java.lang.Object source,
javax.swing.JComponent component)
actionKey - the action's keysource - the object source of actioncomponent - the component doing the action
void fireAction(java.lang.String actionKey,
java.lang.Object source)
actionKey - the action's keysource - the object source of action
void fireAction0(java.lang.String actionKey,
java.lang.Object source,
A action)
actionKey - action's keysource - source of actionaction - real actionvoid dispose()
MyAbstractAction.disposeUI() on each
action, then resetCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||