com.sun.data.provider.impl
Class MethodResultTableDataProvider

java.lang.Object
  extended bycom.sun.data.provider.impl.MethodResultTableDataProvider
All Implemented Interfaces:
DataProvider, RefreshableDataProvider, java.io.Serializable, TableDataProvider

public class MethodResultTableDataProvider
extends java.lang.Object
implements TableDataProvider, RefreshableDataProvider, java.io.Serializable

A TableDataProvider implementation to wrap the return value from a method. Set the dataClassInstance, dataMethod, and dataMethodArguments properties to point to a method on a class instance. The result from that method call will be wrapped as a TableDataProvider, with a row for each element in the returned array or collection. If there is only a single return value, it will be a single row table.

Author:
cao, Joe Nuxoll
See Also:
Serialized Form

Constructor Summary
MethodResultTableDataProvider()
          Constructs a new MethodResultTableDataProvider with no dataClassInstance or dataMethod specified.
MethodResultTableDataProvider(java.lang.Object dataClassInstance, java.lang.reflect.Method dataMethod)
          Constructs a new MethodResultTableDataProvider using the specified dataClassInstance and dataMethod.
 
Method Summary
 void addDataListener(DataListener listener)
          

Register a new DataListener to this DataProvider instance.

 void addRefreshableDataListener(RefreshableDataListener l)
          

Register a new RefreshableDataListener to this RefreshableDataProvider instance.

 void addTableCursorListener(TableCursorListener l)
          

Register a new TableCursorListener to this TableDataProvider instance.

 void addTableDataListener(TableDataListener l)
          

Register a new TableDataListener to this TableDataProvider instance.

 RowKey appendRow()
          

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

 boolean canAppendRow()
          

This method is called to test if this TableDataProvider supports the append operation. If rows can be appended to the list, this method should return true. If the data provider is not resizable, or cannot support an append operation, this method should return false.

 boolean canInsertRow(RowKey beforeRow)
          

This method is called to test if this TableDataProvider supports resizability. If objects can be inserted and removed from the list, this method should return true. If the data provider is not resizable, this method should return false.

The following methods will only be called if this method returns true:

  • insertRow(RowKey beforeRow)
  • appendRow()
  • removeRow(RowKey rowKey)
 boolean canRemoveRow(RowKey row)
          

This method is called to test if this TableDataProvider supports the removeRow operation. If rows can be removed from the table, this method should return true. If the data provider is does not support removing rows, this method should return false.

 boolean cursorFirst()
          

Move the cursor to the first row in this TableDataProvider.

 boolean cursorLast()
          

Move the cursor to the last row in this TableDataProvider.

 boolean cursorNext()
          

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider.

 boolean cursorPrevious()
          

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

protected  void fireRefreshed()
          Fires a refreshed event to each registered RefreshableDataListener
 java.lang.Class getCollectionElementType()
           
 RowKey getCursorRow()
          
 java.lang.Object getDataClassInstance()
          Returns the dataClassInstance that contains the dataMethod to be invoked.
 DataListener[] getDataListeners()
          
 java.lang.reflect.Method getDataMethod()
          Returns the currently set dataMethod
 java.lang.Object[] getDataMethodArguments()
          Returns the dataMethodArguments
 FieldKey getFieldKey(java.lang.String fieldId)
          

Returns the FieldKey associated with the specified data element canonical id, if any; otherwise, return null.

 FieldKey[] getFieldKeys()
          
 RefreshableDataListener[] getRefreshableDataListeners()
          
 java.lang.Object getResultObject()
          Read-only access to the result object from the invokation of the dataMethod
 java.lang.Object[] getResultObjects()
          Read-only access to the result object array from the invokation of the dataMethod
 int getRowCount()
          
 RowKey getRowKey(java.lang.String rowId)
          Returns a RowKey for the specified rowId. This allows a RowKey to be stored off as a simple string, which can be resolved into an instance of a RowKey at a later date.
 RowKey[] getRowKeys(int count, RowKey afterRow)
          Returns an array of RowKey objects representing the requested batch of RowKeys. If null is passed as the afterRow parameter, the returned batch of RowKeys will start with the first one.
 TableCursorListener[] getTableCursorListeners()
          
 TableDataListener[] getTableDataListeners()
          
 java.lang.Class getType(FieldKey fieldKey)
          

Returns the data type of the data element referenced by the specified data key.

 java.lang.Object getValue(FieldKey fieldKey)
          

Returns value of the data element referenced by the specified FieldKey.

 java.lang.Object getValue(FieldKey fieldKey, RowKey row)
          

Return value of the data element referenced by the specified FieldKey and RowKey.

 RowKey insertRow(RowKey beforeRow)
          

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.

 void invokeDataMethod()
          Invokes the dataMethod using the arguments specified by the dataMethodArguments property.
 void invokeDataMethod(java.lang.Object[] args)
          Invokes the dataMethod using the specified arguments.
 boolean isIncludeFields()
           
 boolean isReadOnly(FieldKey fieldKey)
          

Return a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method.

 boolean isRowAvailable(RowKey row)
          Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider; otherwise, return false
 void refresh()
          Invokes the dataMethod on the dataClassInstance to refresh the data provider's contets
protected  void refreshFieldKeys()
          Refreshes the list of available fieldKeys (based on the return type of the dataMethod)
 void removeDataListener(DataListener listener)
          

Deregister an existing DataListener from this DataProvider instance.

 void removeRefreshableDataListener(RefreshableDataListener l)
          

Deregister an existing RefreshableDataListener from RefreshableDataProvider instance.

 void removeRow(RowKey row)
          

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.

 void removeTableCursorListener(TableCursorListener l)
          

Deregister an existing TableCursorListener from this TableDataProvider instance.

 void removeTableDataListener(TableDataListener l)
          

Deregister an existing TableDataListener from this TableDataProvider instance.

 void setCollectionElementType(java.lang.Class elementType)
          If the dataMethod returns a Collection type, this property will be used to determine the appropriate FieldKeys for the elements in the collection type.
 void setCursorRow(RowKey row)
          

Sets the cursor to the row represented by the passed RowKey.

 void setDataClassInstance(java.lang.Object instance)
          Sets the dataClassInstance that contains the dataMethod to be invoked.
 void setDataMethod(java.lang.reflect.Method method)
          Sets the dataMethod that will be invoked
 void setDataMethodArguments(java.lang.Object[] methodArgs)
          Sets the dataMethodArguments, which will be passed to the dataMethod when it is invoked.
 void setIncludeFields(boolean includeFields)
          Sets the includeFields property.
 void setValue(FieldKey fieldKey, java.lang.Object value)
          

Set the value of the data element represented by the specified FieldKey to the specified new value.

 void setValue(FieldKey fieldKey, RowKey row, java.lang.Object value)
          

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.

protected  void testInvokeDataMethod()
          Tests to see if the dataMethod has been invoked, and invokes it if it has not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodResultTableDataProvider

public MethodResultTableDataProvider()
Constructs a new MethodResultTableDataProvider with no dataClassInstance or dataMethod specified.


MethodResultTableDataProvider

public MethodResultTableDataProvider(java.lang.Object dataClassInstance,
                                     java.lang.reflect.Method dataMethod)
Constructs a new MethodResultTableDataProvider using the specified dataClassInstance and dataMethod.

Parameters:
dataClassInstance - The class instance where the method is invoked
dataMethod - The method where the data is from
Method Detail

getDataClassInstance

public java.lang.Object getDataClassInstance()
Returns the dataClassInstance that contains the dataMethod to be invoked.

Returns:
Object

setDataClassInstance

public void setDataClassInstance(java.lang.Object instance)
Sets the dataClassInstance that contains the dataMethod to be invoked.

Parameters:
instance - Object

getDataMethod

public java.lang.reflect.Method getDataMethod()
Returns the currently set dataMethod

Returns:
Method

setDataMethod

public void setDataMethod(java.lang.reflect.Method method)
Sets the dataMethod that will be invoked

Parameters:
method - Method

setCollectionElementType

public void setCollectionElementType(java.lang.Class elementType)
If the dataMethod returns a Collection type, this property will be used to determine the appropriate FieldKeys for the elements in the collection type.

Parameters:
elementType - Class

getCollectionElementType

public java.lang.Class getCollectionElementType()

getResultObject

public java.lang.Object getResultObject()
                                 throws DataProviderException
Read-only access to the result object from the invokation of the dataMethod

Returns:
Object
Throws:
DataProviderException

getResultObjects

public java.lang.Object[] getResultObjects()
                                    throws DataProviderException
Read-only access to the result object array from the invokation of the dataMethod

Returns:
Object[]
Throws:
DataProviderException

setIncludeFields

public void setIncludeFields(boolean includeFields)

Sets the includeFields property. This affects the set of FieldKeys that this DataProvider emits. If includeFields is set to true (the default), then public fields will be included in the list of available keys (intermixed with the public properties). If it is set to false, then only the public properties will be available.

Parameters:
includeFields - true to include the public fields, or false to exclude them (and only show public properties)

isIncludeFields

public boolean isIncludeFields()
Returns:
The boolean state of the includeFields property

refreshFieldKeys

protected void refreshFieldKeys()
Refreshes the list of available fieldKeys (based on the return type of the dataMethod)


setDataMethodArguments

public void setDataMethodArguments(java.lang.Object[] methodArgs)
Sets the dataMethodArguments, which will be passed to the dataMethod when it is invoked.

Parameters:
methodArgs - Object[]

getDataMethodArguments

public java.lang.Object[] getDataMethodArguments()
Returns the dataMethodArguments

Returns:
Object[]

invokeDataMethod

public void invokeDataMethod()
                      throws DataProviderException
Invokes the dataMethod using the arguments specified by the dataMethodArguments property.

Throws:
DataProviderException

invokeDataMethod

public void invokeDataMethod(java.lang.Object[] args)
                      throws DataProviderException
Invokes the dataMethod using the specified arguments.

Parameters:
args - Object[]
Throws:
DataProviderException

testInvokeDataMethod

protected void testInvokeDataMethod()
                             throws DataProviderException
Tests to see if the dataMethod has been invoked, and invokes it if it has not.

Throws:
DataProviderException

refresh

public void refresh()
             throws DataProviderException
Invokes the dataMethod on the dataClassInstance to refresh the data provider's contets

Specified by:
refresh in interface RefreshableDataProvider
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

addRefreshableDataListener

public void addRefreshableDataListener(RefreshableDataListener l)

Register a new RefreshableDataListener to this RefreshableDataProvider instance.

Specified by:
addRefreshableDataListener in interface RefreshableDataProvider
Parameters:
l - New RefreshableDataListener to register

removeRefreshableDataListener

public void removeRefreshableDataListener(RefreshableDataListener l)

Deregister an existing RefreshableDataListener from RefreshableDataProvider instance.

Specified by:
removeRefreshableDataListener in interface RefreshableDataProvider
Parameters:
l - Old RefreshableDataListener to remove

getRefreshableDataListeners

public RefreshableDataListener[] getRefreshableDataListeners()

Specified by:
getRefreshableDataListeners in interface RefreshableDataProvider
Returns:
An array of the RefreshableDataListeners currently registered on this RefreshableDataProvider. If there are no registered listeners, a zero-length array is returned.

fireRefreshed

protected void fireRefreshed()
Fires a refreshed event to each registered RefreshableDataListener

See Also:
RefreshableDataListener.refreshed(RefreshableDataProvider)

getFieldKeys

public FieldKey[] getFieldKeys()
                        throws DataProviderException

Specified by:
getFieldKeys in interface DataProvider
Returns:
An array of all FieldKeys supported by this DataProvider. If the set of valid FieldKeys cannot be determined, return null instead.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null or an empty array. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

getFieldKey

public FieldKey getFieldKey(java.lang.String fieldId)
                     throws DataProviderException

Returns the FieldKey associated with the specified data element canonical id, if any; otherwise, return null.

Specified by:
getFieldKey in interface DataProvider
Parameters:
fieldId - Canonical id of the requested FieldKey
Returns:
the FieldKey associated with the specified data element canonical id, if any; otherwise, return null
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldId is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

getType

public java.lang.Class getType(FieldKey fieldKey)
                        throws DataProviderException

Returns the data type of the data element referenced by the specified data key.

Specified by:
getType in interface DataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose type is to be returned
Returns:
the data type of the data element referenced by the specified data key
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

getValue

public java.lang.Object getValue(FieldKey fieldKey)
                          throws DataProviderException

Returns value of the data element referenced by the specified FieldKey.

Specified by:
getValue in interface DataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be returned
Returns:
value of the data element referenced by the specified FieldKey
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

isReadOnly

public boolean isReadOnly(FieldKey fieldKey)
                   throws DataProviderException

Return a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method.

Specified by:
isReadOnly in interface DataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose settable status is to be returned
Returns:
a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning true. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

setValue

public void setValue(FieldKey fieldKey,
                     java.lang.Object value)
              throws DataProviderException

Set the value of the data element represented by the specified FieldKey to the specified new value.

Specified by:
setValue in interface DataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be modified
value - New value for this data element
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

addDataListener

public void addDataListener(DataListener listener)

Register a new DataListener to this DataProvider instance.

Specified by:
addDataListener in interface DataProvider
Parameters:
listener - New DataListener to register

removeDataListener

public void removeDataListener(DataListener listener)

Deregister an existing DataListener from this DataProvider instance.

Specified by:
removeDataListener in interface DataProvider
Parameters:
listener - Old DataListener to deregister

getDataListeners

public DataListener[] getDataListeners()

Specified by:
getDataListeners in interface DataProvider
Returns:
An array of the DataListeners currently registered on this DataProvider. If there are no registered listeners, a zero-length array is returned.

getRowCount

public int getRowCount()
                throws DataProviderException

Specified by:
getRowCount in interface TableDataProvider
Returns:
the number of rows represented by this TableDataProvider if this information is available; otherwise, return -1 (indicating unknown row count)
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning -1. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

isRowAvailable

public boolean isRowAvailable(RowKey row)
                       throws DataProviderException
Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider; otherwise, return false

Specified by:
isRowAvailable in interface TableDataProvider
Parameters:
row - RowKey specifying row to be tested
Returns:
true if the row is available, false if not
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getRowKeys

public RowKey[] getRowKeys(int count,
                           RowKey afterRow)
                    throws DataProviderException
Returns an array of RowKey objects representing the requested batch of RowKeys. If null is passed as the afterRow parameter, the returned batch of RowKeys will start with the first one.

Specified by:
getRowKeys in interface TableDataProvider
Parameters:
count - The desired count of RowKeys to fetch. If this number exceeds the total number of rows available, the return array will contain the available number, and no exception will be thrown. Consider this an optimistic request of the TableDataProvider.
afterRow - The RowKey that represents the last row before the set of desired RowKeys to be returned. Typically, this is the last RowKey from the previously fetched set of RowKeys. If null is passed, the returned set will begin with the first row.
Returns:
An array of RowKey objects representing the requested batch of rows.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null or an empty array. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getRowKey

public RowKey getRowKey(java.lang.String rowId)
                 throws DataProviderException
Returns a RowKey for the specified rowId. This allows a RowKey to be stored off as a simple string, which can be resolved into an instance of a RowKey at a later date.

Specified by:
getRowKey in interface TableDataProvider
Parameters:
rowId - The cannoncial string ID of the desired RowKey
Returns:
A RowKey object representing the desired row, or null if the specified rowId does not correspond to a row in this TableDataProvider
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getValue

public java.lang.Object getValue(FieldKey fieldKey,
                                 RowKey row)
                          throws DataProviderException

Return value of the data element referenced by the specified FieldKey and RowKey.

Specified by:
getValue in interface TableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be returned
row - RowKey identifying the data row whose value is to be returned
Returns:
value of the data element referenced by the specified FieldKey and RowKey
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that this FieldKey or RowKey does not represent a data element provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

setValue

public void setValue(FieldKey fieldKey,
                     RowKey row,
                     java.lang.Object value)
              throws DataProviderException

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.

Specified by:
setValue in interface TableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be modified
row - RowKey indentifying the data row whose value is to be modified
value - New value for this data element
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this FieldKey or RowKey does not represent a data element provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

canInsertRow

public boolean canInsertRow(RowKey beforeRow)
                     throws DataProviderException

This method is called to test if this TableDataProvider supports resizability. If objects can be inserted and removed from the list, this method should return true. If the data provider is not resizable, this method should return false.

The following methods will only be called if this method returns true:

Specified by:
canInsertRow in interface TableDataProvider
Parameters:
beforeRow - The desired location to insert the new row in front of
Returns:
true if the data provider is resizable, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.insertRow(RowKey)

insertRow

public RowKey insertRow(RowKey beforeRow)
                 throws DataProviderException

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.

Specified by:
insertRow in interface TableDataProvider
Parameters:
beforeRow - The desired location to insert the new row in front of
Returns:
A RowKey representing the address of the newly inserted row
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canInsertRow(RowKey)

canAppendRow

public boolean canAppendRow()
                     throws DataProviderException

This method is called to test if this TableDataProvider supports the append operation. If rows can be appended to the list, this method should return true. If the data provider is not resizable, or cannot support an append operation, this method should return false.

Specified by:
canAppendRow in interface TableDataProvider
Returns:
true if the data provider supports the append operation, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.appendRow()

appendRow

public RowKey appendRow()
                 throws DataProviderException

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

Specified by:
appendRow in interface TableDataProvider
Returns:
The row key for the newly appended row
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canAppendRow()

canRemoveRow

public boolean canRemoveRow(RowKey row)
                     throws DataProviderException

This method is called to test if this TableDataProvider supports the removeRow operation. If rows can be removed from the table, this method should return true. If the data provider is does not support removing rows, this method should return false.

Specified by:
canRemoveRow in interface TableDataProvider
Parameters:
row - The desired row to remove
Returns:
true if the data provider supports removing rows, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.removeRow(RowKey)

removeRow

public void removeRow(RowKey row)
               throws DataProviderException

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.

Specified by:
removeRow in interface TableDataProvider
Parameters:
row - The desired row key to remove
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canRemoveRow(RowKey)

addTableDataListener

public void addTableDataListener(TableDataListener l)

Register a new TableDataListener to this TableDataProvider instance.

Specified by:
addTableDataListener in interface TableDataProvider
Parameters:
l - New TableDataListener to register

removeTableDataListener

public void removeTableDataListener(TableDataListener l)

Deregister an existing TableDataListener from this TableDataProvider instance.

Specified by:
removeTableDataListener in interface TableDataProvider
Parameters:
l - Old TableDataListener to deregister

getTableDataListeners

public TableDataListener[] getTableDataListeners()

Specified by:
getTableDataListeners in interface TableDataProvider
Returns:
An array of the TableDataListeners currently registered on this TableDataProvider. If there are no registered listeners, a zero-length array is returned.

getCursorRow

public RowKey getCursorRow()
                    throws DataProviderException

Specified by:
getCursorRow in interface TableDataProvider
Returns:
the RowKey of the current cursor row position
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

setCursorRow

public void setCursorRow(RowKey row)
                  throws TableCursorVetoException

Sets the cursor to the row represented by the passed RowKey.

Specified by:
setCursorRow in interface TableDataProvider
Parameters:
row - New RowKey to move the cursor to.
Throws:
TableCursorVetoException - if a TableCursorListener decides to veto the cursor navigation

cursorFirst

public boolean cursorFirst()
                    throws DataProviderException

Move the cursor to the first row in this TableDataProvider.

Specified by:
cursorFirst in interface TableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorPrevious

public boolean cursorPrevious()
                       throws DataProviderException

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

Specified by:
cursorPrevious in interface TableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorNext

public boolean cursorNext()
                   throws DataProviderException

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider.

Specified by:
cursorNext in interface TableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorLast

public boolean cursorLast()
                   throws DataProviderException

Move the cursor to the last row in this TableDataProvider.

Specified by:
cursorLast in interface TableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

addTableCursorListener

public void addTableCursorListener(TableCursorListener l)

Register a new TableCursorListener to this TableDataProvider instance.

Specified by:
addTableCursorListener in interface TableDataProvider
Parameters:
l - New TableCursorListener to register

removeTableCursorListener

public void removeTableCursorListener(TableCursorListener l)

Deregister an existing TableCursorListener from this TableDataProvider instance.

Specified by:
removeTableCursorListener in interface TableDataProvider
Parameters:
l - Old TableCursorListener to deregister

getTableCursorListeners

public TableCursorListener[] getTableCursorListeners()

Specified by:
getTableCursorListeners in interface TableDataProvider
Returns:
An array of the TableCursorListeners currently registered on this TableDataProvider. If there are no registered listeners, a zero-length array is returned.