net.sf.doolin.gui.display
Class ConditionalJEXLDisplayStateHandler

java.lang.Object
  extended by net.sf.doolin.gui.display.AbstractDisplayStateHandler
      extended by net.sf.doolin.gui.display.ConditionalJEXLDisplayStateHandler
All Implemented Interfaces:
DisplayStateHandler

public class ConditionalJEXLDisplayStateHandler
extends AbstractDisplayStateHandler

Handler that evaluates a condition on a property of the context.

Author:
Damien Coraboeuf

Constructor Summary
ConditionalJEXLDisplayStateHandler()
           
 
Method Summary
 String getCondition()
           
 DisplayState getDisplayState(ActionContext actionContext)
          Gets the current DisplayState for the given action context
 DisplayState getIfFalseState()
          Gets the if false state.
 DisplayState getIfTrueState()
          Gets the if true state.
 String getPropertyPath()
          Gets the property path.
 void setCondition(String condition)
          Sets the JEXL condition, where 'model' is set for the context data
 void setIfFalseState(DisplayState ifFalseState)
          Display state to return when condition is evaluated to false
 void setIfTrueState(DisplayState ifTrueState)
          Display state to return when condition is evaluated to true
 void setPropertyPath(String propertyPath)
          Sets the path to the property in the context.
 void subscribe(ActionContext actionContext, Runnable task)
          Subscribes a task that is executed each time this display state handler changes its state.
 
Methods inherited from class net.sf.doolin.gui.display.AbstractDisplayStateHandler
connect, connect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalJEXLDisplayStateHandler

public ConditionalJEXLDisplayStateHandler()
Method Detail

getCondition

public String getCondition()

getDisplayState

public DisplayState getDisplayState(ActionContext actionContext)
Description copied from interface: DisplayStateHandler
Gets the current DisplayState for the given action context

Parameters:
actionContext - Action context.
Returns:
Display state

getIfFalseState

public DisplayState getIfFalseState()
Gets the if false state.

Returns:
the if false state

getIfTrueState

public DisplayState getIfTrueState()
Gets the if true state.

Returns:
the if true state

getPropertyPath

public String getPropertyPath()
Gets the property path.

Returns:
the property path

setCondition

public void setCondition(String condition)
Sets the JEXL condition, where 'model' is set for the context data

Parameters:
condition - JEXL expression

setIfFalseState

public void setIfFalseState(DisplayState ifFalseState)
Display state to return when condition is evaluated to false

Parameters:
ifFalseState - Display state to return when condition is evaluated to true

setIfTrueState

public void setIfTrueState(DisplayState ifTrueState)
Display state to return when condition is evaluated to true

Parameters:
ifTrueState - Display state to return when condition is evaluated to true

setPropertyPath

public void setPropertyPath(String propertyPath)
Sets the path to the property in the context.

Parameters:
propertyPath - the new property path

subscribe

public void subscribe(ActionContext actionContext,
                      Runnable task)
Description copied from interface: DisplayStateHandler
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


Copyright © 2011. All Rights Reserved.