home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.3 KB | 83 lines |
- /*
- * DbaDataLink.java 1.0 12 Jan 1997
- *
- * Copyright (c) 1996 Krumel & Associates, Inc. All Rights Reserved.
- *
- * This software is provided as is. Krumel & Associates shall not be liable
- * for any damages suffered by licensee as a result of using, modifying or
- * distributing this software or its derivatives.
- */
-
- package symantec.itools.db.awt;
-
- import symantec.itools.db.pro.*;
- import java.sql.SQLException ;
-
- /**
- * This helper class implements interfaces RecordLink and RecordSetLink.
- * It is used by the DbaDataStore class to maintain a link to the current
- * database record.
- *
- * @see symantec.itools.db.pro.RecordLink
- * @see symantec.itools.db.pro.RecordSetLink
- */
- class DbaDataLink implements RecordSetLink, RecordLink
- {
- DbaDataStore store;
- int recordNumber;
- RelationView rv;
-
- /**
- * Constructs a DbaDataLink for the given DbaDataStore.
- *
- * @param s the data store using this object
- */
- public DbaDataLink(DbaDataStore s)
- {
- store = s;
- }
-
- /**
- * Called when this object is bound to a RelationView.
- * <p>
- * This is a method in the RecordLink and RecordSetLink interfaces.
- *
- * @see symantec.itools.db.pro.RecordLink#init
- * @see symantec.itools.db.pro.RecordSetLink#init
- */
- public void init()
- {
- recordNumber = -1;
- }
-
- /**
- * This method is called when a RelationView's RecordSet is changed.
- * <p>
- * This is a method in the RecordSetLink interface.
- *
- * @param rv used to access the RelationView bound to this object
- *
- * @see symantec.itools.db.pro.RecordSetLink#notifyRecordSetChange
- */
- public void notifyRecordSetChange(RelationView rv) throws SQLException
- {
- store.resetRows();
- }
-
- /**
- * This method is called when the current Record in the RelationView is changed.
- * <p>
- * This is a method in the RecordLink interface.
- *
- * @param currentRec used to access the current record bound to this object
- *
- * @see symantec.itools.db.pro.RecordLink#notifyRecordChange
- */
- public void notifyRecordChange (Record currentRec) throws SQLException
- {
- if (currentRec != null)
- {
- store.notifyRecordChange();
- }
- }
- }