net.sf.doolin.gui.field.table.style
Class PropertyValueTableStyle

java.lang.Object
  extended by net.sf.doolin.gui.field.table.style.PropertyValueTableStyle
All Implemented Interfaces:
TableStyle

public class PropertyValueTableStyle
extends Object
implements TableStyle

Style that applies another style according to the value of a property of the row item.

Author:
Damien Coraboeuf

Constructor Summary
PropertyValueTableStyle()
           
 
Method Summary
 TableStyle getDefaultStyle()
          Gets the default style.
 String getPropertyPath()
          Gets the property path.
 Style getStyle(Object item, JTable table, int row, int column)
          Gets the style to apply on the table.
 Map<String,TableStyle> getStyleMap()
          Gets the style map.
 void setDefaultStyle(TableStyle defaultStyle)
          Sets the default style to apply if the property value is not found in the map.
 void setPropertyPath(String propertyPath)
          Sets the property path.
 void setStyleMap(Map<String,TableStyle> styleMap)
          Sets the styles indexed by property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyValueTableStyle

public PropertyValueTableStyle()
Method Detail

getStyle

public Style getStyle(Object item,
                      JTable table,
                      int row,
                      int column)
Description copied from interface: TableStyle
Gets the style to apply on the table.

Specified by:
getStyle in interface TableStyle
Parameters:
item - Item associated to the row
table - Table
row - Row index
column - Column index
Returns:
Style to apply

getStyleMap

public Map<String,TableStyle> getStyleMap()
Gets the style map.

Returns:
the style map

setStyleMap

public void setStyleMap(Map<String,TableStyle> styleMap)
Sets the styles indexed by property value.

Parameters:
styleMap - the style map

getPropertyPath

public String getPropertyPath()
Gets the property path.

Returns:
the property path

setPropertyPath

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

Parameters:
propertyPath - the new property path

getDefaultStyle

public TableStyle getDefaultStyle()
Gets the default style.

Returns:
the default style

setDefaultStyle

public void setDefaultStyle(TableStyle defaultStyle)
Sets the default style to apply if the property value is not found in the map.

Parameters:
defaultStyle - the new default style


Copyright © 2011. All Rights Reserved.