/** * Searches a converter for the given <code>action</code> and <code>target</code>. * @param <A> the type that the converter will produce * @param <D> the type of action needed as input * @param action the action that will be transformed * @param target the target platform * @return the converter or <code>null</code> if no converter is found */ protected <A, D extends DockAction> ViewGenerator<D,A> getConverter( ActionType<D> action, ViewTarget<? super A> target ){ Entry<D, A> entry = getEntry( action, target ); if( entry.clientGenerator != null ) return entry.clientGenerator; if( entry.themeGenerator != null ) return entry.themeGenerator; return entry.defaultGenerator; }
/** * Searches a converter for the given <code>action</code> and <code>target</code>. * @param <A> the type that the converter will produce * @param <D> the type of action needed as input * @param action the action that will be transformed * @param target the target platform * @return the converter or <code>null</code> if no converter is found */ protected <A, D extends DockAction> ViewGenerator<D,A> getConverter( ActionType<D> action, ViewTarget<? super A> target ){ Entry<D, A> entry = getEntry( action, target ); if( entry.clientGenerator != null ) return entry.clientGenerator; if( entry.themeGenerator != null ) return entry.themeGenerator; return entry.defaultGenerator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the normal priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putTheme( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.themeGenerator = generator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the high priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putClient( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.clientGenerator = generator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the high priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putClient( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.clientGenerator = generator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the low priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putDefault( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.defaultGenerator = generator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the normal priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putTheme( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.themeGenerator = generator; }
/** * Registers a new {@link ViewGenerator} to this ActionViewConverter. The * generator will have the low priority. * @param <A> the type of view created by the converter * @param <D> the type of action needed as input for the converter * @param action the type of actions needed as input * @param target the platform for which <code>converter</code> creates output * @param generator the generator to store, may be <code>null</code> */ public <A, D extends DockAction> void putDefault( ActionType<D> action, ViewTarget<A> target, ViewGenerator<D,A> generator ){ if( action == null ) throw new IllegalArgumentException( "Action must not be null" ); if( target == null ) throw new IllegalArgumentException( "Target must not be null" ); Entry<D,A> entry = getEntry( action, target ); entry.defaultGenerator = generator; }