org.drools.guvnor.client.widgets.decoratedgrid.data
Class DynamicData

java.lang.Object
  extended by org.drools.guvnor.client.widgets.decoratedgrid.data.DynamicData
All Implemented Interfaces:
Iterable<DynamicDataRow>

public class DynamicData
extends Object
implements Iterable<DynamicDataRow>

A simple container for rows of data.


Constructor Summary
DynamicData()
           
 
Method Summary
 void addColumn(int index, List<CellValue<? extends Comparable<?>>> columnData, boolean isVisible)
          Add column to data
 DynamicDataRow addRow()
          Add an empty row of data to the end of the table
 DynamicDataRow addRow(int index, List<CellValue<? extends Comparable<?>>> rowData)
          Add a row of data at the specified index
 DynamicDataRow addRow(List<CellValue<? extends Comparable<?>>> rowData)
          Add a row of data at the end of the table
 void applyModelGrouping(CellValue<?> startCell)
          Apply grouping by collapsing applicable rows
 void clear()
           
 void deleteColumn(int index)
          Delete column data
 DynamicDataRow deleteRow(int index)
           
 CellValue<? extends Comparable<?>> get(Coordinate c)
          Get the CellValue at the given coordinate
 DynamicDataRow get(int index)
           
 DynamicData getFlattenedData()
          Return grid's data.
 int indexOf(DynamicDataRow row)
           
 boolean isMerged()
          Return the state of merging
 Iterator<DynamicDataRow> iterator()
           
 List<DynamicDataRow> removeModelGrouping(CellValue<?> startCell)
          Remove grouping by expanding applicable rows
 void set(Coordinate c, Object value)
          Set the value at the specified coordinate
 void setColumnVisibility(int index, boolean isVisible)
          Set whether a columns is Visible
 void setMerged(boolean isMerged)
          Set whether the grid's data is merged or not.
 void setOnRowChangeCommand(com.google.gwt.user.client.Command cmd)
          Configure a command that can be executed whenever a row is added\deleted.
 int size()
           
 void sort(List<SortConfiguration> sortConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicData

public DynamicData()
Method Detail

addColumn

public void addColumn(int index,
                      List<CellValue<? extends Comparable<?>>> columnData,
                      boolean isVisible)
Add column to data

Parameters:
index -
columnData -

addRow

public DynamicDataRow addRow()
Add an empty row of data to the end of the table

Returns:
DynamicDataRow The newly created row

addRow

public DynamicDataRow addRow(int index,
                             List<CellValue<? extends Comparable<?>>> rowData)
Add a row of data at the specified index

Parameters:
index -
rowData -
Returns:
DynamicDataRow The newly created row

addRow

public DynamicDataRow addRow(List<CellValue<? extends Comparable<?>>> rowData)
Add a row of data at the end of the table

Parameters:
rowData -
Returns:
DynamicDataRow The newly created row

applyModelGrouping

public void applyModelGrouping(CellValue<?> startCell)
Apply grouping by collapsing applicable rows

Parameters:
startCell -

clear

public void clear()

deleteColumn

public void deleteColumn(int index)
Delete column data

Parameters:
index -

deleteRow

public DynamicDataRow deleteRow(int index)

get

public CellValue<? extends Comparable<?>> get(Coordinate c)
Get the CellValue at the given coordinate

Parameters:
c -
Returns:

get

public DynamicDataRow get(int index)

getFlattenedData

public DynamicData getFlattenedData()
Return grid's data. Grouping in the data will be expanded and can therefore can be used prior to populate the underlying data structures prior to persisting.

Returns:
data

indexOf

public int indexOf(DynamicDataRow row)

isMerged

public boolean isMerged()
Return the state of merging

Returns:

iterator

public Iterator<DynamicDataRow> iterator()
Specified by:
iterator in interface Iterable<DynamicDataRow>

removeModelGrouping

public List<DynamicDataRow> removeModelGrouping(CellValue<?> startCell)
Remove grouping by expanding applicable rows

Parameters:
startCell -
Returns:

set

public void set(Coordinate c,
                Object value)
Set the value at the specified coordinate

Parameters:
c -
value -

setColumnVisibility

public void setColumnVisibility(int index,
                                boolean isVisible)
Set whether a columns is Visible

Parameters:
index - index of column
isVisible - True if the column is visible

setMerged

public void setMerged(boolean isMerged)
Set whether the grid's data is merged or not. Clearing merging within the data also clears grouping

Parameters:
isMerged -

setOnRowChangeCommand

public void setOnRowChangeCommand(com.google.gwt.user.client.Command cmd)
Configure a command that can be executed whenever a row is added\deleted. This allows consumers of DynamicData to ensure column values are within keeping of their requirements. E.G. A Column containing a Row Number can be updated etc

Parameters:
cmd -

size

public int size()

sort

public void sort(List<SortConfiguration> sortConfig)


Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.