Servoy 5.x Public API

com.servoy.j2db.dataprocessing
Interface IFoundSet

All Superinterfaces:
com.servoy.j2db.dataprocessing.IFoundSetDeprecated, IGlobalValueEntry

public interface IFoundSet
extends com.servoy.j2db.dataprocessing.IFoundSetDeprecated, IGlobalValueEntry

The public foundset interface

Since:
Servoy 5.0

Field Summary
static int AGGREGATEVARIABLES
           
static int COLUMNS
           
static int SCRIPTCALCULATIONS
           
 
Method Summary
 void addFoundSetEventListener(IFoundSetEventListener l)
          Add a foundset listener
 void clear()
          Remove the records from memory
 IFoundSet copy(boolean unrelate)
          Makes a copy/clone of the foundset
 void deleteAllRecords()
          Delete all records from foundset and datasource
 void deleteRecord(int row)
          Delete a record from foundset and datasource
 int duplicateRecord(int recordIndex, int indexToAdd)
          Duplicate a record
 String[] getDataProviderNames(int type)
          The dataprovider names
 String getDataSource()
          The datasource this foundset is build on
 IRecord getRecord(int row)
          Get a record object, getting the last of current size might trigger a load of more records if more present
 int getRecordIndex(IRecord record)
          Get the index of a record object inside a foundset
 IRecord[] getRecords(int startrow, int count)
          Get multiple record Objects at once
 String getRelationName()
          The relation name if this foundset is a related foundset
 int getSelectedIndex()
          Get the selected index
 int getSize()
          Get the size of present cached row identifiers (primary keys)
 String getSort()
          Returns the current sort string of this Foundset like "column1 asc, column2 desc"
 boolean isInFindMode()
          Returns true if this foundset is in find mode and false otherwise.
 boolean isRecordEditable(int row)
          Check if a records is editable
 void loadAllRecords()
          Load the initial records inside (back into) this foundset from datasource
 int newRecord(int indexToAdd, boolean changeSelection)
          Create a new Record
 void removeFoundSetEventListener(IFoundSetEventListener l)
          remove a foundset listener
 void setSelectedIndex(int selectedRow)
          Set the selected index
 void setSort(String sortString)
          Sets the sort string of the Foundset can be something like "column 1 asc, column2 desc" Will sort the Foundset immediately when the Foundset is not in find mode.
 
Methods inherited from interface com.servoy.j2db.dataprocessing.IFoundSetDeprecated
browseAll, deleteAll, duplicateRecord, getRecordToStringDataProviderID, makeEmpty, newRecord, newRecord, newRecord, setRecordToStringDataProviderID, sort
 
Methods inherited from interface com.servoy.j2db.dataprocessing.IGlobalValueEntry
containsDataProvider, getDataProviderValue, setDataProviderValue
 

Field Detail

AGGREGATEVARIABLES

static final int AGGREGATEVARIABLES
See Also:
Constant Field Values

COLUMNS

static final int COLUMNS
See Also:
Constant Field Values

SCRIPTCALCULATIONS

static final int SCRIPTCALCULATIONS
See Also:
Constant Field Values
Method Detail

addFoundSetEventListener

void addFoundSetEventListener(IFoundSetEventListener l)
Add a foundset listener

Parameters:
l - the listener

clear

void clear()
Remove the records from memory


copy

IFoundSet copy(boolean unrelate)
               throws ServoyException
Makes a copy/clone of the foundset

Parameters:
unrelate - If true then it wil unrelated this foundset, detach it from its relation
Returns:
The cloned foundset.
Throws:
ServoyException

deleteAllRecords

void deleteAllRecords()
                      throws ServoyException
Delete all records from foundset and datasource

Throws:
ServoyException

deleteRecord

void deleteRecord(int row)
                  throws ServoyException
Delete a record from foundset and datasource

Parameters:
row -
Throws:
ServoyException

duplicateRecord

int duplicateRecord(int recordIndex,
                    int indexToAdd)
                    throws ServoyException
Duplicate a record

Parameters:
recordIndex - to duplicate
indexToAdd - the index to place the record, Integer.MAX_VALUE means bottom
Returns:
the index of the new record
Throws:
ServoyException

getDataProviderNames

String[] getDataProviderNames(int type)
The dataprovider names

Parameters:
type - of dataprovider, see constants in this interface
Returns:
the array of dataproviders

getDataSource

String getDataSource()
The datasource this foundset is build on

Returns:
the datasource

getRecord

IRecord getRecord(int row)
Get a record object, getting the last of current size might trigger a load of more records if more present

Parameters:
row - the index to retrieve
Returns:
the record Object

getRecordIndex

int getRecordIndex(IRecord record)
Get the index of a record object inside a foundset

Parameters:
record - the records object
Returns:
the index or -1 if not present (anymore)

getRecords

IRecord[] getRecords(int startrow,
                     int count)
Get multiple record Objects at once

Parameters:
startrow - the index to start from
count - the number of records object to get
Returns:
array of records objects

getRelationName

String getRelationName()
The relation name if this foundset is a related foundset

Returns:
the relation name, null if not related

getSelectedIndex

int getSelectedIndex()
Get the selected index

Returns:
the index

getSize

int getSize()
Get the size of present cached row identifiers (primary keys)

Returns:
the number of rows which can be received via getRecord

getSort

String getSort()
Returns the current sort string of this Foundset like "column1 asc, column2 desc"

Returns:
The sort string.

isInFindMode

boolean isInFindMode()
Returns true if this foundset is in find mode and false otherwise.

Returns:
foundset's find mode.

isRecordEditable

boolean isRecordEditable(int row)
Check if a records is editable

Parameters:
row - the index
Returns:
true if editable

loadAllRecords

void loadAllRecords()
                    throws ServoyException
Load the initial records inside (back into) this foundset from datasource

Throws:
ServoyException

newRecord

int newRecord(int indexToAdd,
              boolean changeSelection)
              throws ServoyException
Create a new Record

Parameters:
indexToAdd - the index to place the record, Integer.MAX_VALUE means bottom
changeSelection - change the selection to this new record
Returns:
the index of the new record
Throws:
ServoyException

removeFoundSetEventListener

void removeFoundSetEventListener(IFoundSetEventListener l)
remove a foundset listener

Parameters:
l - the listener

setSelectedIndex

void setSelectedIndex(int selectedRow)
Set the selected index

Parameters:
selectedRow - the index

setSort

void setSort(String sortString)
             throws ServoyException
Sets the sort string of the Foundset can be something like "column 1 asc, column2 desc" Will sort the Foundset immediately when the Foundset is not in find mode.

Parameters:
sortString -
Throws:
ServoyException

Copyright © 2010 Servoy B.V.