|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.jaxx.action.ActionFactoryFromProvider<A>
A - the type of actionpublic class ActionFactoryFromProvider<A extends MyAbstractAction>
A simple implementation of ActionFactory using some ActionProvider to seek actions.
action.actionName=fqn where
actionName is the key of action used in factory, and
fqn is the fully qualified name of the implemented action class.
A special clase is to have for a given entry a key like this : action.:fqn'=fqn, in that case,
le fqn' is a classe of type ActionNameProvider which gives us at
runtime the names of each entry to put in cache for the givne action fqn.
| Field Summary | |
|---|---|
protected ActionConfigConfigurationResolver |
actionConfigInitializer
|
protected Class<A> |
baseImpl
class of encapsuling action |
protected List<AbstractActionConfigurationResolver> |
configurationResolvers
|
protected static org.apache.commons.logging.Log |
log
|
protected SelectActionConfigConfigurationResolver |
selectActionConfigInitializer
|
protected ToggleActionConfigConfigurationResolver |
toggleActionConfigInitializer
|
| Constructor Summary | |
|---|---|
protected |
ActionFactoryFromProvider(Class<A> baseImpl)
|
| Method Summary | ||
|---|---|---|
Set<Map.Entry<String,A>> |
cacheEntrySet()
|
|
protected void |
checkRegistredAction(String actionKey)
|
|
void |
dispose()
dispose all actions in cache using MyAbstractAction.disposeUI() on each
action, then ActionFactory.resetCache() |
|
protected void |
finalize()
|
|
protected void |
finalizeNewAction(AbstractButton component,
MyAbstractAction action,
ActionConfigurationResolver<?,?> configurationResolver)
|
|
protected void |
finalizeNewAction(JComboBox component,
MyAbstractAction action,
ActionConfigurationResolver<?,?> configurationResolver)
|
|
void |
fireAction(String actionKey,
Object source)
Fire an action given his key and his source, no widget are involved here |
|
void |
fireAction(String actionKey,
Object source,
JComponent component)
Fire an action given his key, his source and tthe widget responsible of action |
|
void |
fireAction0(String actionKey,
Object source,
A action)
Fire an action given his action's key, his source and the real action. |
|
static URLClassLoader |
fixClassLoader(Class<?> klass)
Fix the class loader when application is launched from a java -jar The ServiceLoader seems not to find services from jar manifest... |
|
A |
getActionFromCache(String actionKey)
|
|
String[] |
getActionNames()
|
|
Class<A> |
getBaseClass()
|
|
Set<Map.Entry<String,Class<? extends MyAbstractAction>>> |
implsEntrySet()
|
|
Map<String,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(String actionKey)
Obtain an action instance given his key (should call ActionFactory.newAction(String, JComponent)
This is a convinient method when you want to obtain an action with no attached widget. |
|
A |
newAction(String actionKey,
JComponent component)
Obtain an action instance given his key and widget |
|
protected A |
newActionInstance(String actionKey)
|
|
static
|
newInstance(Class<A> klazz)
|
|
protected
|
registerInitializer(Class<I> initizalizer)
|
|
void |
resetCache()
clear the cache of instanciated actions. |
|
protected ActionConfigurationResolver |
resolveActionConfiguration(MyAbstractAction action)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
protected Class<A extends MyAbstractAction> baseImpl
protected final ActionConfigConfigurationResolver actionConfigInitializer
protected final ToggleActionConfigConfigurationResolver toggleActionConfigInitializer
protected final SelectActionConfigConfigurationResolver selectActionConfigInitializer
protected List<AbstractActionConfigurationResolver> configurationResolvers
| Constructor Detail |
|---|
protected ActionFactoryFromProvider(Class<A> baseImpl)
| Method Detail |
|---|
public static <A extends MyAbstractAction> ActionFactory<A> newInstance(Class<A> klazz)
public Class<A> getBaseClass()
getBaseClass in interface ActionFactory<A extends MyAbstractAction>public void resetCache()
ActionFactory
resetCache in interface ActionFactory<A extends MyAbstractAction>public void loadActions(JAXXObject ui)
ActionFactory
loadActions in interface ActionFactory<A extends MyAbstractAction>ui - the ui to treate
public A newAction(String actionKey,
JComponent component)
ActionFactory
newAction in interface ActionFactory<A extends MyAbstractAction>actionKey - le nom de l'action tel que définie dans le fichier
de mapping (sans le prefix action.)component - le button où rattacher l'action
public A newAction(String actionKey)
ActionFactoryActionFactory.newAction(String, JComponent)
This is a convinient method when you want to obtain an action with no attached widget.
newAction in interface ActionFactory<A extends MyAbstractAction>actionKey - the key of action
ActionFactory.getActionFromCache(String)public String[] getActionNames()
getActionNames in interface ActionFactory<A extends MyAbstractAction>public Set<Map.Entry<String,Class<? extends MyAbstractAction>>> implsEntrySet()
implsEntrySet in interface ActionFactory<A extends MyAbstractAction>public Set<Map.Entry<String,A>> cacheEntrySet()
cacheEntrySet in interface ActionFactory<A extends MyAbstractAction>
public void fireAction(String actionKey,
Object source,
JComponent component)
ActionFactory
fireAction in interface ActionFactory<A extends MyAbstractAction>actionKey - the action's keysource - the object source of actioncomponent - the component doing the action
public void fireAction(String actionKey,
Object source)
ActionFactory
fireAction in interface ActionFactory<A extends MyAbstractAction>actionKey - the action's keysource - the object source of actionpublic A getActionFromCache(String actionKey)
getActionFromCache in interface ActionFactory<A extends MyAbstractAction>actionKey - la clef de l'action
null si non trouvée.public void dispose()
ActionFactoryMyAbstractAction.disposeUI() on each
action, then ActionFactory.resetCache()
dispose in interface ActionFactory<A extends MyAbstractAction>
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected void finalizeNewAction(AbstractButton component,
MyAbstractAction action,
ActionConfigurationResolver<?,?> configurationResolver)
component - le button où rattacher l'actionaction - actionconfigurationResolver - initializer
protected void finalizeNewAction(JComboBox component,
MyAbstractAction action,
ActionConfigurationResolver<?,?> configurationResolver)
component - le select box où rattacher l'actionaction - actionconfigurationResolver - initializerprotected ActionConfigurationResolver resolveActionConfiguration(MyAbstractAction action)
protected <I extends AbstractActionConfigurationResolver> I registerInitializer(Class<I> initizalizer)
public void fireAction0(String actionKey,
Object source,
A action)
ActionFactory
fireAction0 in interface ActionFactory<A extends MyAbstractAction>actionKey - action's keysource - source of actionaction - real actionprotected void checkRegistredAction(String actionKey)
protected A newActionInstance(String actionKey)
throws InstantiationException,
IllegalAccessException,
InvocationTargetException,
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodExceptionpublic Map<String,Class<? extends MyAbstractAction>> init()
ActionFactory
init in interface ActionFactory<A extends MyAbstractAction>public static URLClassLoader fixClassLoader(Class<?> klass)
klass - class to use to obtain classloader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||