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

java.lang.Object
  extended by org.drools.guvnor.client.widgets.drools.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
 void addRow(DynamicDataRow rowData)
          Add a row of data at the end of the table
 void addRow(int index, DynamicDataRow rowData)
          Add a row of data at the specified index
 void applyModelGrouping(CellValue<?> startCell)
          Apply grouping by collapsing applicable rows
 void assertModelMerging()
          Ensure merging and indexing is reflected in the entire model.
 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 isGrouped()
          Return the state of grouping
 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.
 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 void addRow(int index,
                   DynamicDataRow rowData)
Add a row of data at the specified index

Parameters:
index -
rowData -

addRow

public void addRow(DynamicDataRow rowData)
Add a row of data at the end of the table

Parameters:
rowData -

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:

isGrouped

public boolean isGrouped()
Return the state of grouping

Returns:
true if any rows are grouped

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 -

size

public int size()

sort

public void sort(List<SortConfiguration> sortConfig)

assertModelMerging

public void assertModelMerging()
Ensure merging and indexing is reflected in the entire model. This should be called whenever any changes are made to the underlying data externally to the add/remove methods provided publicly herein, such as bulk move operations.



Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.