alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

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.
 */

/*
 * NewIdentifierOperator.java
 *
 * Created on 10/1/02 11:41 AM
 */
package org.netbeans.jellytools.modules.java;

import org.netbeans.jellytools.Bundle;
import org.netbeans.jemmy.operators.*;

/** Class implementing all necessary methods for handling "Enter New Identifier" NbPresenter.
 *
 * @author jb105785
 * @version 1.0
 */
public class NewIdentifierOperator extends JDialogOperator {

    /** Creates new NewIdentifierOperator that can handle it.
     */
    public NewIdentifierOperator() {
        super(Bundle.getString("org.openide.explorer.propertysheet.editors.Bundle2", "LAB_NewIdentifier"));
    }

    private JLabelOperator _lblNewName;
    private JTextFieldOperator _txtNewName;
    private JButtonOperator _btOK;
    private JButtonOperator _btCancel;


    //******************************
    // Subcomponents definition part
    //******************************

    /** Tries to find "New Name:" JLabel in this dialog.
     * @return JLabelOperator
     */
    public JLabelOperator lblNewName() {
        if (_lblNewName==null) {
            _lblNewName = new JLabelOperator(this, Bundle.getString("org.openide.actions.Bundle", "CTL_RenameLabel"));
        }
        return _lblNewName;
    }

    /** Tries to find null JTextField in this dialog.
     * @return JTextFieldOperator
     */
    public JTextFieldOperator txtNewName() {
        if (_txtNewName==null) {
            _txtNewName = new JTextFieldOperator(this);
        }
        return _txtNewName;
    }

    /** Tries to find "OK" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btOK() {
        if (_btOK==null) {
            _btOK = new JButtonOperator(this, Bundle.getString("org.openide.Bundle", "CTL_OK"));
        }
        return _btOK;
    }

    /** Tries to find "Cancel" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btCancel() {
        if (_btCancel==null) {
            _btCancel = new JButtonOperator(this, Bundle.getString("org.openide.Bundle", "CTL_CANCEL"));
        }
        return _btCancel;
    }


    //****************************************
    // Low-level functionality definition part
    //****************************************

    /** gets text for txtNewName
     * @return String text
     */
    public String getNewName() {
        return txtNewName().getText();
    }

    /** sets text for txtNewName
     * @param text String text
     */
    public void setNewName(String text) {
        txtNewName().setText(text);
    }

    /** types text for txtNewName
     * @param text String text
     */
    public void typeNewName(String text) {
        txtNewName().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 NewIdentifierOperator by accessing all its components.
     */
    public void verify() {
        lblNewName();
        txtNewName();
        btOK();
        btCancel();
    }

    /** Performs simple test of NewIdentifierOperator
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        new NewIdentifierOperator().verify();
        System.out.println("NewIdentifierOperator verification finished.");
    }
}

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.