org.nuiton.jaxx.action
Class AbstractActionConfigurationResolver<A extends java.lang.annotation.Annotation,C extends javax.swing.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 java.lang.annotation.Annotation,C extends javax.swing.JComponent>
extends java.lang.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  java.lang.Class<A> annotationImpl
          the type of configuration's annotation
protected  java.lang.Class<C> componentImpl
          the type of component that can fire an action
 
Constructor Summary
protected AbstractActionConfigurationResolver(java.lang.Class<A> annotationImpl, java.lang.Class<C> componentImpl)
           
 
Method Summary
 A applyConfiguration(javax.swing.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.
 java.lang.Class<A> getAnnotationImpl()
           
 java.lang.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 java.lang.Class<A extends java.lang.annotation.Annotation> annotationImpl
the type of configuration's annotation


componentImpl

protected final java.lang.Class<C extends javax.swing.JComponent> componentImpl
the type of component that can fire an action

Constructor Detail

AbstractActionConfigurationResolver

protected AbstractActionConfigurationResolver(java.lang.Class<A> annotationImpl,
                                              java.lang.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 java.lang.annotation.Annotation,C extends javax.swing.JComponent>
Parameters:
action - current action
Returns:
the configuration of the action

applyConfiguration

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

getAnnotationImpl

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

getComponentImpl

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


Copyright © 2008-2009 CodeLutin. All Rights Reserved.