org.nuiton.jaxx.action
Class AbstractActionConfigurationResolver<A extends Annotation,C extends JComponent>

java.lang.Object
  extended by org.nuiton.jaxx.action.AbstractActionConfigurationResolver<A,C>
Type Parameters:
A - type of annotation
C - type of component
All Implemented Interfaces:
ActionConfigurationResolver<A,C>
Direct Known Subclasses:
ActionConfigConfigurationResolver, SelectActionConfigConfigurationResolver, ToggleActionConfigConfigurationResolver

public abstract class AbstractActionConfigurationResolver<A extends Annotation,C extends JComponent>
extends Object
implements ActionConfigurationResolver<A,C>

Common abstract class of a resolver of action configuration.

The class implements the logic of research of the configuration annotation.

Author:
chemit

Field Summary
protected  Class<A> annotationImpl
          the type of configuration's annotation
protected  Class<C> componentImpl
          the type of component that can fire an action
 
Constructor Summary
protected AbstractActionConfigurationResolver(Class<A> annotationImpl, Class<C> componentImpl)
           
 
Method Summary
 A applyConfiguration(JComponent component, MyAbstractAction action)
           
protected abstract  A applyConfiguration0(C component, MyAbstractAction action)
          The typed method (on component) to apply configuration on the action and component.
 Class<A> getAnnotationImpl()
           
 Class<C> getComponentImpl()
           
 A resolveConfiguration(MyAbstractAction action)
          Search the annotation that configure the given action (or the boxed action).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotationImpl

protected final Class<A extends Annotation> annotationImpl
the type of configuration's annotation


componentImpl

protected final Class<C extends JComponent> componentImpl
the type of component that can fire an action

Constructor Detail

AbstractActionConfigurationResolver

protected AbstractActionConfigurationResolver(Class<A> annotationImpl,
                                              Class<C> componentImpl)
Method Detail

applyConfiguration0

protected abstract A applyConfiguration0(C component,
                                         MyAbstractAction action)
The typed method (on component) to apply configuration on the action and component.

Parameters:
component - the component which fires the action
action - the given action
Returns:
the configuration's annotation

resolveConfiguration

public A resolveConfiguration(MyAbstractAction action)
Description copied from interface: ActionConfigurationResolver
Search the annotation that configure the given action (or the boxed action).

Specified by:
resolveConfiguration in interface ActionConfigurationResolver<A extends Annotation,C extends JComponent>
Parameters:
action - current action
Returns:
the configuration of the action

applyConfiguration

public A applyConfiguration(JComponent component,
                            MyAbstractAction action)
Specified by:
applyConfiguration in interface ActionConfigurationResolver<A extends Annotation,C extends JComponent>
Parameters:
component - widget that requires the action
action - given action
Returns:
the configuration of the action

getAnnotationImpl

public Class<A> getAnnotationImpl()
Specified by:
getAnnotationImpl in interface ActionConfigurationResolver<A extends Annotation,C extends JComponent>
Returns:
the configuration annotation dealed by this resolver

getComponentImpl

public Class<C> getComponentImpl()
Specified by:
getComponentImpl in interface ActionConfigurationResolver<A extends Annotation,C extends JComponent>
Returns:
the class of the component which can fired the action


Copyright © 2008-2010 CodeLutin. All Rights Reserved.