net.sf.doolin.gui.display
Interface DisplayStateHandler

All Known Implementing Classes:
AbstractContextPropertyDisplayStateHandler, AbstractDisplayStateHandler, AbstractFixedDisplayStateHandler, AbstractSimpleDisplayStateHandler, AbstractWizardDisplayStateHandler, AdaptedContextPropertyDisplayStateHandler, AlwaysDisabledDisplayStateHandler, AlwaysEnabledDisplayStateHandler, AlwaysHiddenDisplayStateHandler, AndDisplayStateHandler, ConditionalDisplayStateHandler, ConditionalJEXLDisplayStateHandler, ContextDisplayStateHandler, FinishDisplayStateHandler, MultiDisplayStateHandler, NextDisplayStateHandler, NotDisplayStateHandler, OrDisplayStateHandler, PreviousDisplayStateHandler, SystemPropertyDisplayStateHandler, ValidationDisplayStateHandler

public interface DisplayStateHandler

Defines the display state of a field.

Author:
Damien Coraboeuf

Method Summary
 void connect(ActionContext actionContext, Object bean, String propertyPath)
          Connects this DisplayStateHandler to the given property and for the given ActionContext.
<T> void
connect(ActionContext actionContext, Object bean, String propertyPath, Adapter<DisplayState,T> adapter)
          Connects this DisplayStateHandler to the given property and for the given ActionContext.
 DisplayState getDisplayState(ActionContext actionContext)
          Gets the current DisplayState for the given action context
 void subscribe(ActionContext actionContext, Runnable task)
          Subscribes a task that is executed each time this display state handler changes its state.
 

Method Detail

connect

void connect(ActionContext actionContext,
             Object bean,
             String propertyPath)
Connects this DisplayStateHandler to the given property and for the given ActionContext. Each time this display state handler changes its state, this new state will be set in the given property of the given bean.

Parameters:
actionContext - Action context
bean - Target bean
propertyPath - Path to the property in the target bean that will contain the new state

connect

<T> void connect(ActionContext actionContext,
                 Object bean,
                 String propertyPath,
                 Adapter<DisplayState,T> adapter)
Connects this DisplayStateHandler to the given property and for the given ActionContext. Each time this display state handler changes its state, this new state will be converted to another type and will be set in the given property of the given bean.

Type Parameters:
T - Type of the target property
Parameters:
actionContext - Action context
bean - Target bean
propertyPath - Path to the property in the target bean that will contain the converted new state
adapter - Adapter to convert the new state to the type of the target property

subscribe

void subscribe(ActionContext actionContext,
               Runnable task)
Subscribes a task that is executed each time this display state handler changes its state.

Parameters:
actionContext - Action context for this display state handler
task - Task to run each time the state change

getDisplayState

DisplayState getDisplayState(ActionContext actionContext)
Gets the current DisplayState for the given action context

Parameters:
actionContext - Action context.
Returns:
Display state


Copyright © 2011. All Rights Reserved.