    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class netscape.peas.TableSupport

    java.lang.Object
       |
       +----netscape.peas.RowSupport
               |
               +----netscape.peas.TableSupport

public class TableSupport
extends RowSupport
implements Table

Helper class for which provides simple implemenation of the Table interface.

##

TableSupport(boolean)
TableSupport(Table, boolean)

##

addRow()
  add an empty row
addRowValues(Object[], boolean)
  Add rows to this table, and notify listeners.
addTableChangeListener(TableChangeListener)
deleteRow()
  Delete the current row, and notify listeners.
deleteRow(int, boolean)
  Delete the specified row from the table.
doSetCurrentRowNumber(int, boolean, boolean, NotifyList)
  setCurrentRowNumber allows clients of this Table adjust its "currentRowNumber" property.
doUpdateRow(Object[], Object[], Object[])
  Helper to perform actual database update.
executeQuery()
  Perform "generic" executeQuery functionality.
fetchMoreRows()
  No default behavior yet, must be handled by Subclass/Delegator.
fireTableChange(int, int, int, Object, TableProvider, NotifyList)
getCurrentRowNumber()
  getCurrentRowNumber allows clients of this Table to get the value of its its "currentRowNumber" property.
getCurrentRowValues()
getFetchBufferSize()
  Setter method for this cursor's "bufferSize" property.
getInterface(String)
  Return an object which implements this specified (fully qualified) interface name.
getNonCurrentRowValues(int)
  Return the values of this row
getNumRowsFetched()
  Getter method for "NumRowsFetched" property.
getQuery()
  Getter method for this cursor's "query" property.
getRowsPending()
  Getter for the booelan "rowsPending" property.
getTable()
isCurrentRowChanged()
  Return true if current row has been changed
isValidRowNumber(int)
nextRow()
  Change the position of this cursor to the next row.
previousRow()
  Change the position of this cursor to the next row.
removeTableChangeListener(TableChangeListener)
setColumnNames(String[], int[], NotifyList)
  This method sets this table's row's column info.
setCurrentRowNumber(int)
setFetchBufferSize(int)
  Getter method for this cursor's "bufferSize" property.
setQuery(String)
  Setter method for this cursor's "query" property.
setRowsPending(boolean)
setTableValue(int, int, Object, NotifyList)
  Method to set this table's value at row# iRow and column# iColumn.
setValueByNumber(int, Object, NotifyList)
  Override the RowSupport method so that we can notify TableChangeListeners using a TableChangeEvent.
tableChange(TableChangeEvent)
updateCurrentRow()
  Update (to underlying database) this table's current row

##

TableSupport

     public TableSupport(boolean bOwnsDataContext)

TableSupport

     public TableSupport(Table oDelegator,
                         boolean bOwnsDataContext)

##

getInterface

     public Object getInterface(String sInterfaceName)

  Return an object which implements this specified (fully qualified) interface name. If this interface is not implemented, return null.

  Overrides:
    getInterface in class RowSupport

getQuery

     public String getQuery()

  Getter method for this cursor's "query" property.

setQuery

     public void setQuery(String sNewQuery)

  Setter method for this cursor's "query" property.

getFetchBufferSize

     public int getFetchBufferSize()

  Setter method for this cursor's "bufferSize" property. this specifies the number of rows fetched when the query is executed, and on successive fetchMoreRows() calls. A buffer size of 0 means that all rows are fetched before control is returned from executeQuery.

setFetchBufferSize

     public void setFetchBufferSize(int iNewBufferSize)

  Getter method for this cursor's "bufferSize" property. this specifies the number of rows fetched when the query is executed, and on successive fetchMoreRows() calls.

executeQuery

     public void executeQuery()

  Perform "generic" executeQuery functionality. This entails initializing the table to be empty. Subclasses or Delegators need to do their executeQuery stuff before invoking this code.

deleteRow

     public void deleteRow(int iRowNumber,
                           boolean bNotify)

  Delete the specified row from the table. Notify listeners client of table support should perform delete on database, and then delegate to this implementation only if delete was successful.

deleteRow

     public void deleteRow()

  Delete the current row, and notify listeners.

addRow

     public void addRow()

  add an empty row

getNumRowsFetched

     public int getNumRowsFetched()

  Getter method for "NumRowsFetched" property. This is the total number of rows satisfying the query if and only if the "rowsPending" property is true.

getRowsPending

     public boolean getRowsPending()

  Getter for the booelan "rowsPending" property.

fetchMoreRows

     public void fetchMoreRows()

  No default behavior yet, must be handled by Subclass/Delegator.

getCurrentRowNumber

     public int getCurrentRowNumber()

  getCurrentRowNumber allows clients of this Table to get the value of its its "currentRowNumber" property. It ought to be exposed in the beaninfo as the "read" method for this property.

doSetCurrentRowNumber

     public boolean doSetCurrentRowNumber(int iNewRowNumber,
                                          boolean bNotify,
                                          boolean bUpdateView,
                                          NotifyList oNotifyList)

  setCurrentRowNumber allows clients of this Table adjust its "currentRowNumber" property. It ought to be exposed in the beaninfo as the "write" method for this property.

setCurrentRowNumber

     public boolean setCurrentRowNumber(int iNewRowNumber)

nextRow

     public boolean nextRow()

  Change the position of this cursor to the next row. Return false if there is none.

previousRow

     public boolean previousRow()

  Change the position of this cursor to the next row. Return false if there is none.

doUpdateRow

     public void doUpdateRow(Object aColumnNames[],
                             Object aNewValues[],
                             Object aOldValues[])

  Helper to perform actual database update. This, or updateCurrentRow can be overridden to actually sen data to the database.

isCurrentRowChanged

     public boolean isCurrentRowChanged()

  Return true if current row has been changed

updateCurrentRow

     public void updateCurrentRow()

  Update (to underlying database) this table's current row

getTable

     public Table getTable()

getCurrentRowValues

     public RowProvider getCurrentRowValues()

addTableChangeListener

     public void addTableChangeListener(TableChangeListener oListener)

removeTableChangeListener

     public void removeTableChangeListener(TableChangeListener oListener)

fireTableChange

     public void fireTableChange(int iChangeType,
                                 int iRowAffected,
                                 int iColumnAffected,
                                 Object oNewValue,
                                 TableProvider oTableProvider,
                                 NotifyList oNotify)

getNonCurrentRowValues

     public Object[] getNonCurrentRowValues(int iRowNumber)

  Return the values of this row

tableChange

     public void tableChange(TableChangeEvent oEvent)

setTableValue

     public void setTableValue(int iRow,
                               int iColumn,
                               Object oNewValue,
                               NotifyList oNotifyList)

  Method to set this table's value at row# iRow and column# iColumn.

setColumnNames

     public void setColumnNames(String aColumnNames[],
                                int aColumnWidths[],
                                NotifyList oNotify)

  This method sets this table's row's column info. It gets called in the following cases: A RowChangeEvent.COLUMN_INFO_CHANGED causes our superclass (RowSupport) to call this method to set column info A TableChangeEvent.COLUMN_INFO_CHANGED causes us to call this method. In both cases we first delegate to ROW_SUPPORT, which performs the actual change, and also notifies its RowChangeListener s, and then notify our TableChangeListener s

  Overrides:
    setColumnNames in class RowSupport

setRowsPending

     protected void setRowsPending(boolean bNewValue)

addRowValues

     protected void addRowValues(Object aValues[],
                                 boolean bNotifyListeners)

  Add rows to this table, and notify listeners. Clients wishing to implement insert ought to do insertAtEnd, then call this method to add values to this table

setValueByNumber

     public void setValueByNumber(int iColumnNumber,
                                  Object oNewValue,
                                  NotifyList oNotifyList)

  Override the RowSupport method so that we can notify TableChangeListeners using a TableChangeEvent. This gets called in various cases: our "RowListener" interface gets notified of a rowChangeEvent.ROW_VALUE_CHANGED. our "TableListenter" interface gets called on a TableChangeEvent.TABLE_VALUE_CHANGED our Delegator's view gets changed by the user our Delegator's model gets chagned by the user We split this into two cases: current row and non-current row

  Overrides:
    setValueByNumber in class RowSupport

isValidRowNumber

     public boolean isValidRowNumber(int iRowNumber)

    All Packages  Class Hierarchy  This Package  Previous  Next  Index