|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.jellytools.modules.db; import org.netbeans.jemmy.operators.*; /** * Class implementing all necessary methods for handling "Add JDBC Driver" NbDialog. * * @author Patrik Knakal * @version 1.0 */ public class AddJDBCDriverOperator extends JDialogOperator { /** Creates new AddJDBCDriverOperator that can handle it. */ public AddJDBCDriverOperator() { super("Add JDBC Driver"); //NOI18N } private JTextFieldOperator _txtName; private JTextFieldOperator _txtDriver; private JTextFieldOperator _txtDatabaseURLPrefix; private JButtonOperator _btOK; private JButtonOperator _btCancel; //****************************** // Subcomponents definition part //****************************** /** Tries to find null JTextField in this dialog. * @return JTextFieldOperator */ public JTextFieldOperator txtName() { if (_txtName==null) { _txtName = new JTextFieldOperator(this); } return _txtName; } /** Tries to find null JTextField in this dialog. * @return JTextFieldOperator */ public JTextFieldOperator txtDriver() { if (_txtDriver==null) { _txtDriver = new JTextFieldOperator(this, 1); } return _txtDriver; } /** Tries to find null JTextField in this dialog. * @return JTextFieldOperator */ public JTextFieldOperator txtDatabaseURLPrefix() { if (_txtDatabaseURLPrefix==null) { _txtDatabaseURLPrefix = new JTextFieldOperator(this, 2); } return _txtDatabaseURLPrefix; } /** Tries to find "OK" JButton in this dialog. * @return JButtonOperator */ public JButtonOperator btOK() { if (_btOK==null) { _btOK = new JButtonOperator(this, "OK"); //NOI18N } return _btOK; } /** Tries to find "Cancel" JButton in this dialog. * @return JButtonOperator */ public JButtonOperator btCancel() { if (_btCancel==null) { _btCancel = new JButtonOperator(this, "Cancel"); //NOI18N } return _btCancel; } //**************************************** // Low-level functionality definition part //**************************************** /** gets text for txtName * @return String text */ public String getName() { return txtName().getText(); } /** sets text for txtName * @param text String text */ public void setName(String text) { txtName().setText(text); } /** types text for txtName * @param text String text */ public void typeName(String text) { txtName().typeText(text); } /** gets text for txtDriver * @return String text */ public String getDriver() { return txtDriver().getText(); } /** sets text for txtDriver * @param text String text */ public void setDriver(String text) { txtDriver().setText(text); } /** types text for txtDriver * @param text String text */ public void typeDriver(String text) { txtDriver().typeText(text); } /** gets text for txtDatabaseURLPrefix * @return String text */ public String getDatabaseURLPrefix() { return txtDatabaseURLPrefix().getText(); } /** sets text for txtDatabaseURLPrefix * @param text String text */ public void setDatabaseURLPrefix(String text) { txtDatabaseURLPrefix().setText(text); } /** types text for txtDatabaseURLPrefix * @param text String text */ public void typeDatabaseURLPrefix(String text) { txtDatabaseURLPrefix().typeText(text); } /** clicks on "OK" JButton */ public void oK() { btOK().push(); } /** clicks on "Cancel" JButton */ public void cancel() { btCancel().push(); } //***************************************** // High-level functionality definition part //***************************************** /** Performs verification of AddJDBCDriverOperator by accessing all its components. */ public void verify() { txtName(); txtDriver(); txtDatabaseURLPrefix(); btOK(); btCancel(); } /** Performs simple test of AddJDBCDriverOperator * @param args the command line arguments */ public static void main(String args[]) { new AddJDBCDriverOperator().verify(); System.out.println("AddJDBCDriverOperator verification finished."); //NOI18N } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.