com.tekann.codegen.pda.db
Class DTODataSource

java.lang.Object
  extended by com.tekann.codegen.pda.db.DTODataSource
All Implemented Interfaces:
totalcross.ui.Grid.DataSource

public class DTODataSource
extends java.lang.Object
implements totalcross.ui.Grid.DataSource

Grid DataSource that saves the DTOs.

Author:
Evandro Rathke

Field Summary
protected  java.lang.String[] columnNames
           
protected  IDAO dao
           
protected  totalcross.util.Vector dtos
           
protected  java.lang.String[][] values
           
protected  IViewForm viewForm
           
 
Constructor Summary
DTODataSource(IDAO dao, IViewForm viewForm)
          Constructs DTODataSource
 
Method Summary
 IDataFormatter getDataFormatter()
           
 IDTO getDTOAt(int row)
          Gets the DTO by the passed row.
 java.lang.Object[] getDTOs()
          Gets all the DTOs
protected  java.lang.String getFormattedValue(IDTOColumn column, java.lang.Object value)
           
 int getItemCount()
          Gets the item count.
 java.lang.String[][] getItems(int startIndex, int count)
           
 IDTO removeDTOAt(int row)
          Removes the DTO.
 void setDataFormatter(IDataFormatter dataFormatter)
           
 void setDTOs(java.lang.Object[] dtos, java.lang.String[] columnNames, int count)
          Sets the grid's DTO.
protected  void setValues(java.lang.Object[] dtos, int count)
          Sets the values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

protected java.lang.String[] columnNames

dao

protected IDAO dao

dtos

protected totalcross.util.Vector dtos

values

protected java.lang.String[][] values

viewForm

protected IViewForm viewForm
Constructor Detail

DTODataSource

public DTODataSource(IDAO dao,
                     IViewForm viewForm)
Constructs DTODataSource

Parameters:
dao -
viewForm -
Method Detail

getDTOAt

public IDTO getDTOAt(int row)
Gets the DTO by the passed row.

Parameters:
row -
Returns:
An IDTO

getDTOs

public java.lang.Object[] getDTOs()
Gets all the DTOs

Returns:
An Object array

getItemCount

public int getItemCount()
Gets the item count.

Returns:
An integer

getItems

public java.lang.String[][] getItems(int startIndex,
                                     int count)
Specified by:
getItems in interface totalcross.ui.Grid.DataSource

removeDTOAt

public IDTO removeDTOAt(int row)
Removes the DTO.

Parameters:
row - The row to be removed
Returns:
The removed IDTO

setDTOs

public void setDTOs(java.lang.Object[] dtos,
                    java.lang.String[] columnNames,
                    int count)
Sets the grid's DTO. Create an array of items that will be shown.

Parameters:
dtos -
count - number of lines to be shown

setValues

protected void setValues(java.lang.Object[] dtos,
                         int count)
Sets the values

Parameters:
dtos -
count -

getFormattedValue

protected java.lang.String getFormattedValue(IDTOColumn column,
                                             java.lang.Object value)

setDataFormatter

public void setDataFormatter(IDataFormatter dataFormatter)

getDataFormatter

public IDataFormatter getDataFormatter()