home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 3.9 KB | 110 lines |
- /*
- * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
- *
- * This SOURCE CODE FILE, which has been provided by Borland as part
- * of a Borland product for use ONLY by licensed users of the product,
- * includes CONFIDENTIAL and PROPRIETARY information of Borland.
- *
- * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
- * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
- * THE PRODUCT.
- *
- * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
- * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
- * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
- * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
- * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
- * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
- * CODE FILE.
- */
-
- //Title: Cliffhanger Adventure Gear
- //Version:
- //Copyright: Copyright (c) 1997 Borland International, Inc.
- //Author: Application Methods, Inc.
- //Description: Cliffhanger Adventure Gear order entry system
-
- package borland.reference.cliffhanger;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.control.*;
- import borland.sql.dataset.*;
- import borland.jbcl.dataset.*;
- import java.util.*;
-
- /**
- * CustomerFindFrame is inherited from FindFrame which is the base form for
- * all Find windows in the Cliffhanger application.
- * This find forms allows users to lookup customers by searching on a value for
- * a single column in the customer dataset. A grid displays all the records
- * for the datasets, and the grid will try to find the closet
- * matching record as the user types in the search value.
- */
- public class CustomerFindFrame extends FindFrame {
- private static DataModule1 dm = DataModule1.getDataModule();
- private static CustomerFindFrame myCustomerFindFrame;
- // private QueryDataSet qdsCustomer;
- ResourceBundle res = Res.getBundle("borland.reference.cliffhanger.Res");
-
- /**
- * The constructor is protected. Use the getCustomerFindFrame method to get
- * an instance of the class.
- */
- protected CustomerFindFrame() {
- try {
- jbInit(); // initialize frame's controls (JBuilder designer)
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void jbInit() throws Exception{
- this.setTitle(res.getString("CFF_Find_Customer"));
- statusBar1.setDataSet(dm.getCustomerDataSet());
- locatorControl1.setDataSet(dm.getCustomerDataSet());
- gridControl1.setDataSet(dm.getCustomerDataSet());
- choiceControl1.setItems(new String [] { res.getString("DM_CustomerDS_LASTNAME"), res.getString("DM_CustomerDS_FIRSTNAME"), res.getString("DM_CustomerDS_PHONE"), res.getString("DM_CustomerDS_ID") });
- }
-
- /**
- * Class method to access the singleton instance of the class.
- */
- public static CustomerFindFrame getCustomerFindFrame() {
- if (myCustomerFindFrame == null)
- myCustomerFindFrame = new CustomerFindFrame();
-
- return myCustomerFindFrame;
- }
-
- /**
- * When the Go To button is clicked, override this event handler
- * to show the appropriate form for the record selected, then
- * close this form.
- */
- void btnGoto_actionPerformed(ActionEvent e) {
- // Show the Customer form and show it centered in the screen
- DecoratedFrame frame = CustomerFrame.getCustomerFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
-
- // Hide this frame ...
- this.setVisible(false);
- this.dispose();
- }
-
- }
-
- class CustomerFindFrame_btnGoto_actionAdapter implements java.awt.event.ActionListener{
- CustomerFindFrame adaptee;
-
- CustomerFindFrame_btnGoto_actionAdapter(CustomerFindFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.btnGoto_actionPerformed(e);
- }
- }
-