Class netscape.peas.TableSupport
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.peas.TableSupport

netscape.peas.RowSupport
   |
   +----netscape.peas.TableSupport

public class TableSupport
extends RowSupport
implements Table
Helper class for which provides simple implemenation of the Table interface.

Constructor Index

 o TableSupport(boolean)
 o TableSupport(Table, boolean)

Method Index

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

Constructors

 o TableSupport
  public TableSupport(boolean bOwnsDataContext)
 o TableSupport
  public TableSupport(Table oDelegator,
                      boolean bOwnsDataContext)

Methods

 o 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
 o getQuery
  public String getQuery()
Getter method for this cursor's "query" property.
 o setQuery
  public void setQuery(String sNewQuery)
Setter method for this cursor's "query" property.
 o 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.
 o 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.
 o 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.
 o 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.
 o deleteRow
  public void deleteRow()
Delete the current row, and notify listeners.
 o addRow
  public void addRow()
add an empty row
 o 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.
 o getRowsPending
  public boolean getRowsPending()
Getter for the booelan "rowsPending" property.
 o fetchMoreRows
  public void fetchMoreRows()
No default behavior yet, must be handled by Subclass/Delegator.
 o 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.
 o 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.
 o setCurrentRowNumber
  public boolean setCurrentRowNumber(int iNewRowNumber)
 o nextRow
  public boolean nextRow()
Change the position of this cursor to the next row. Return false if there is none.
 o previousRow
  public boolean previousRow()
Change the position of this cursor to the next row. Return false if there is none.
 o 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.
 o isCurrentRowChanged
  public boolean isCurrentRowChanged()
Return true if current row has been changed
 o updateCurrentRow
  public void updateCurrentRow()
Update (to underlying database) this table's current row
 o getTable
  public Table getTable()
 o getCurrentRowValues
  public RowProvider getCurrentRowValues()
 o addTableChangeListener
  public void addTableChangeListener(TableChangeListener oListener)
 o removeTableChangeListener
  public void removeTableChangeListener(TableChangeListener oListener)
 o fireTableChange
  public void fireTableChange(int iChangeType,
                              int iRowAffected,
                              int iColumnAffected,
                              Object oNewValue,
                              TableProvider oTableProvider,
                              NotifyList oNotify)
 o getNonCurrentRowValues
  public Object[] getNonCurrentRowValues(int iRowNumber)
Return the values of this row
 o tableChange
  public void tableChange(TableChangeEvent oEvent)
 o 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.
 o 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
 o setRowsPending
  protected void setRowsPending(boolean bNewValue)
 o 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
 o 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
 o isValidRowNumber
  public boolean isValidRowNumber(int iRowNumber)

All Packages  Class Hierarchy  This Package  Previous  Next  Index