net.sf.doolin.gui.display
Class AdaptedContextPropertyDisplayStateHandler<S>

java.lang.Object
  extended by net.sf.doolin.gui.display.AbstractDisplayStateHandler
      extended by net.sf.doolin.gui.display.AbstractContextPropertyDisplayStateHandler<S>
          extended by net.sf.doolin.gui.display.AdaptedContextPropertyDisplayStateHandler<S>
Type Parameters:
S - Type of the property to convert to a display state
All Implemented Interfaces:
DisplayStateHandler

public class AdaptedContextPropertyDisplayStateHandler<S>
extends AbstractContextPropertyDisplayStateHandler<S>

This display state handler is based on a property of the context. This property is adapted to a display state using an adapter.

Author:
Damien Coraboeuf

Constructor Summary
AdaptedContextPropertyDisplayStateHandler()
          Default constructor
AdaptedContextPropertyDisplayStateHandler(String propertyPath, Adapter<S,DisplayState> adapter)
          Constructor.
 
Method Summary
 Adapter<S,DisplayState> getAdapter()
          Gets the adapter.
protected  DisplayState getDisplayState(S property)
          Computes the display state from the given property value
 void setAdapter(Adapter<S,DisplayState> adapter)
          Sets the adapter.
 
Methods inherited from class net.sf.doolin.gui.display.AbstractContextPropertyDisplayStateHandler
getDisplayState, getPropertyPath, setPropertyPath, subscribe
 
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

AdaptedContextPropertyDisplayStateHandler

public AdaptedContextPropertyDisplayStateHandler()
Default constructor


AdaptedContextPropertyDisplayStateHandler

public AdaptedContextPropertyDisplayStateHandler(String propertyPath,
                                                 Adapter<S,DisplayState> adapter)
Constructor.

Parameters:
propertyPath - Path to the property of the context to take into account
adapter - Adapter from the property to the display date
Method Detail

getAdapter

public Adapter<S,DisplayState> getAdapter()
Gets the adapter.

Returns:
the adapter

setAdapter

public void setAdapter(Adapter<S,DisplayState> adapter)
Sets the adapter.

Parameters:
adapter - the adapter

getDisplayState

protected DisplayState getDisplayState(S property)
Description copied from class: AbstractContextPropertyDisplayStateHandler
Computes the display state from the given property value

Specified by:
getDisplayState in class AbstractContextPropertyDisplayStateHandler<S>
Parameters:
property - Property value
Returns:
Display state


Copyright © 2011. All Rights Reserved.