borland Packages  Class Hierarchy  jbcl.dataset Package  Index 

EditListener interface

java.util.EventListener
   +----borland.jbcl.dataset.EditListener

About the EditListener interface

Methods  

Implemented by EditAdapter

This interface is used as a notification for row editing before and after edit-related operations are completed and includes

With an EditListener, you can

Inserting, adding, and updating methods each have a unique purpose. Insert methods create a new, unposted row, which is equivalent to using the Insert button on the NavigatorControl. The new, unposted row is sometimes called a pseudo-row because it does not exist in the data set until it is posted. Add methods work on newly inserted rows when they are about to be or have been posted. Update methods work on existing rows only, at the time that modifications to them are about to be or have been posted.

A simple way for an application to pass an error message to display in the UI involves the EditListener before event (those that end in "ing"). These events can be wired to throw a Exception("custom message"). In turn, this gets thrown as a chained ValidationException that copies the "custom message" as the message for the ValidationException. Since all ValidationExceptions go to a StatusListener, for example the StatusBar control, the custom message displays in the application's UI.


EditListener methods

Methods defined in this interface


EditListener methods

added(borland.jbcl.dataset.DataSet)

  void added(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners that a new row is successfully posted to the DataSet. This event is fired by DataSet.addRow(), which inserts, modifies, and posts a row all in one operation.

Parameters:

dataSet
The data set the row was added to.

addError(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.ReadWriteRow, borland.jbcl.dataset.DataSetException, borland.jbcl.util.ErrorResponse)

  void addError(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.ReadWriteRow row, borland.jbcl.dataset.DataSetException ex, borland.jbcl.util.ErrorResponse response)
This is an event to notify listeners when an exception is thrown for row add operations. Call response.abort() (the default) to cause the operation to fail with an appropriate DataSetException or ValidationException. Call response.retry() to cause the operation to be retried. Be sure that the retry will succeed or that your code can handle repeated retries. Call response.ignore() to cause the operation to silently fail without an exception being thrown.

Parameters:

dataSet
The data set that has the error.
row
The row that contains the error.
ex
The type of exception that was thrown.
response
The type of response to the error.

adding(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.ReadWriteRow)

  void adding(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.ReadWriteRow newRow)
This is an event to notify listeners before a new row is posted to the DataSet. This event is fired by DataSet.addRow(), which inserts, modifies, and posts a row all in one operation. If a VetoException or Exception is thrown inside this method, the post operation is not performed, a ValidationException with an error code of APPLICATION_ERROR is thrown instead. The adding() method is called before checks to make sure all required fields are not null. If a VetoException or Exception is constructed with a STRING parameter, this STRING is used in the default error handling displays, for example,
throw new VetoException("My error message");

Parameters:

dataSet
The dataSet that the row will be posted to.
newRow
The row that is to be inserted, modified, and posted.

canceling(borland.jbcl.dataset.DataSet)

  void canceling(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners when the editing of a new or existing row in a DataSet is about to be canceled. An application might use this event to save undo information.

Parameters:

dataSet
The data set to which edits are about to be canceled.

deleted(borland.jbcl.dataset.DataSet)

  void deleted(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners that a successful delete operation has been performed.

Parameters:

dataSet
The data set from which rows have been deleted.

deleteError(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.DataSetException, borland.jbcl.util.ErrorResponse)

  void deleteError(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.DataSetException ex, borland.jbcl.util.ErrorResponse response)
This is an event to notify listeners when an exception is thrown for row delete operations. Call response.abort() (the default) to causes the operation to fail with an appropriate DataSetException or ValidationException. Call response.retry() to cause the operation to be retried. Be sure that the retry will succeed or that your code can handle repeated retries. Call response.ignore() to cause the operation to silently fail without throwing an exception.

Parameters:

dataSet
The data set that has the error.
ex
The type of exception that was thrown.
response
The type of response to the error.

deleting(borland.jbcl.dataset.DataSet)

  void deleting(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners before a row is deleted from the DataSet. If a VetoException or Exception is thrown inside this method, the delete operation is not performed, a ValidationException with an error code of APPLICATION_ERROR is thrown instead. If a VetoException or Exception is constructed with a STRING parameter, this STRING is used in the default error handling displays, for example,
throw new VetoException("My error message");

Parameters:

dataSet
The data set from which a row is about to be deleted.

editError(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.Column, borland.jbcl.util.Variant, borland.jbcl.dataset.DataSetException, borland.jbcl.util.ErrorResponse)

  void editError(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.Column column, borland.jbcl.util.Variant value, borland.jbcl.dataset.DataSetException ex, borland.jbcl.util.ErrorResponse response)
This is an event to notify listeners when any exceptions occur setting a column value. This includes validation check failures as well as any VetoExceptions thrown by a ColumnChangeListener.validating() event handler. The ErrorResponse object allows the user to indicate how the error should be handled. Call response.abort() (the default) to cause the operation to fail with an appropriate DataSetException or ValidationException. Call response.retry() to cause the operation to be retried. Be sure that the retry will succeed or that your code can handle repeated retries. Call response.ignore() to cause the operation to silently fail without an exception being thrown.

Parameters:

dataSet
The data set that has the error.
column
The column that contains the error.
value
The value that causes the error.
ex
The type of exception that was thrown.
response
The type of response to the error.

inserted(borland.jbcl.dataset.DataSet)

  void inserted(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners that a new, unposted row is inserted into the DataSet. This event can be used to initialize row values of new rows.

Parameters:

dataSet
The data set to which the row has just been inserted.

inserting(borland.jbcl.dataset.DataSet)

  void inserting(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners just before a DataSet attempts to insert a new, unposted row. If a VetoException or Exception is thrown inside this method, the insert operation is not performed, a ValidationException with an error code of APPLICATION_ERROR is thrown instead. If a VetoException or Exception is constructed with a STRING parameter, this STRING is used in the default error handling displays, for example,
throw new VetoException("My error message");)

Parameters:

dataSet
The data set to which the row is about to be inserted.

modifying(borland.jbcl.dataset.DataSet)

  void modifying(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners when a user begins to modify an existing row. If a VetoException or Exception is thrown inside this method, the modify operation is not performed, a ValidationException with an error code of APPLICATION_ERROR is thrown instead. If a VetoException or Exception is constructed with a STRING parameter, this STRING is used in the default error handling displays, for example,
throw new VetoException("My error message");

Parameters:

dataSet
The data set that contains the row being modified.

updated(borland.jbcl.dataset.DataSet)

  void updated(borland.jbcl.dataset.DataSet dataSet)
This is an event to notify listeners that a modified row has been successfully posted to a DataSet.

Parameters:

dataSet
The data set to which the modified row has has been posted.

updateError(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.ReadWriteRow, borland.jbcl.dataset.DataSetException, borland.jbcl.util.ErrorResponse)

  void updateError(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.ReadWriteRow row, borland.jbcl.dataset.DataSetException ex, borland.jbcl.util.ErrorResponse response)
This is an event to notify listeners when an exception is thrown for row changes. Call response.abort() (the default) to cause the operation to fail with an appropriate DataSetException or ValidationException. Call response.retry() to cause the operation to be retried. Be sure that the retry will succeed or that your code can handle repeated retries. Call response.ignore() to cause the operation to silently fail without an exception being thrown.

Parameters:

dataSet
The data set that has the error.
row
The row that contains the error.
ex
The type of exception that was thrown.
response
The type of response to the error.

updating(borland.jbcl.dataset.DataSet, borland.jbcl.dataset.ReadWriteRow, borland.jbcl.dataset.ReadRow)

  void updating(borland.jbcl.dataset.DataSet dataSet, borland.jbcl.dataset.ReadWriteRow newRow, borland.jbcl.dataset.ReadRow oldRow)
This is an event to notify listeners before a modified row is posted to the DataSet. If an exception is thrown inside this method, the post operation is not performed, a ValidationException with an error code of APPLICATION_ERROR is thrown instead. The updating() method is called before checks to make sure all required fields are not null. If a VetoException or Exception is constructed with a STRING parameter, this STRING is used in the default error handling displays, for example,
throw new VetoException("My error message");

Parameters:

dataSet
The data set to which a modified row is about to be posted.
newRow
The row containing the modified data.
oldRow
The row containing the data in the row prior to modification.