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

/*
 * ExternalCompilerOperator.java
 *

 */
package org.netbeans.jellytools.modules.java;

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

/** Class implementing all necessary methods for handling "External Compiler" NbDialog.
 *
 * @author jb105785
 * @version 1.0
 */
public class ExternalCompilerOperator extends JDialogOperator {

    /** Creates new ExternalCompilerOperator that can handle it.
     */
    public ExternalCompilerOperator() {
        super(Bundle.getString("org.netbeans.modules.java.settings.Bundle", "PROP_EXTERNAL_COMPILER"));
    }

    private JLabelOperator _lblProcess;
    private JTextFieldOperator _txtProcess;
    private JButtonOperator _btJButton;
    private JLabelOperator _lblArguments;
    private JTextAreaOperator _txtArguments;
    private JButtonOperator _btMetalScrollButton;
    private JButtonOperator _btMetalScrollButton2;
    private JLabelOperator _lblArgumentKey;
    private JTextAreaOperator _txtArgumentKey;
    private JButtonOperator _btOK;
    private JButtonOperator _btCancel;
    private JButtonOperator _btHelp;


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

    /** Tries to find "Process:" JLabel in this dialog.
     * @return JLabelOperator
     */
    public JLabelOperator lblProcess() {
        if (_lblProcess==null) {
            _lblProcess = new JLabelOperator(this, Bundle.getString("org.netbeans.core.execution.beaninfo.editors.Bundle", "CTL_NbProcessDescriptorCustomEditor.processLabel.text"));
        }
        return _lblProcess;
    }

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

    /** Tries to find "..." JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btJButton() {
        if (_btJButton==null) {
            _btJButton = new JButtonOperator(this, Bundle.getString("org.netbeans.core.execution.beaninfo.editors.Bundle", "CTL_NbProcessDescriptorCustomEditor.jButton1.text"));
        }
        return _btJButton;
    }

    /** Tries to find "Arguments:" JLabel in this dialog.
     * @return JLabelOperator
     */
    public JLabelOperator lblArguments() {
        if (_lblArguments==null) {
            _lblArguments = new JLabelOperator(this, Bundle.getString("org.netbeans.core.execution.beaninfo.editors.Bundle", "CTL_NbProcessDescriptorCustomEditor.argumentsLabel.text"));
        }
        return _lblArguments;
    }

    /** Tries to find null JTextArea in this dialog.
     * @return JTextAreaOperator
     */
    public JTextAreaOperator txtArguments() {
        if (_txtArguments==null) {
            _txtArguments = new JTextAreaOperator(this);
        }
        return _txtArguments;
    }

    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton() {
        if (_btMetalScrollButton==null) {
            _btMetalScrollButton = new JButtonOperator(this, "", 1);
        }
        return _btMetalScrollButton;
    }

    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton2() {
        if (_btMetalScrollButton2==null) {
            _btMetalScrollButton2 = new JButtonOperator(this, "", 2);
        }
        return _btMetalScrollButton2;
    }

    /** Tries to find "Argument Key" JLabel in this dialog.
     * @return JLabelOperator
     */
    public JLabelOperator lblArgumentKey() {
        if (_lblArgumentKey==null) {
            _lblArgumentKey = new JLabelOperator(this, Bundle.getString("org.netbeans.core.execution.beaninfo.editors.Bundle", "CTL_NbProcessDescriptorCustomEditor.argumentKeyLabel.text"));
        }
        return _lblArgumentKey;
    }

    /** Tries to find null JTextArea in this dialog.
     * @return JTextAreaOperator
     */
    public JTextAreaOperator txtArgumentKey() {
        if (_txtArgumentKey==null) {
            _txtArgumentKey = new JTextAreaOperator(this, 1);
        }
        return _txtArgumentKey;
    }

    /** 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;
    }

    /** Tries to find "Help" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btHelp() {
        if (_btHelp==null) {
            _btHelp = new JButtonOperator(this, Bundle.getString("org.openide.Bundle", "CTL_HelpName"));
        }
        return _btHelp;
    }


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

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

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

    /** types text for txtProcess
     * @param text String text
     */
    public void typeProcess(String text) {
        txtProcess().typeText(text);
    }

    /** clicks on "..." JButton
     */
    public void jButton() {
        btJButton().push();
    }

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

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

    /** types text for txtArguments
     * @param text String text
     */
    public void typeArguments(String text) {
        txtArguments().typeText(text);
    }

    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton() {
        btMetalScrollButton().push();
    }

    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton2() {
        btMetalScrollButton2().push();
    }

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

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

    /** types text for txtArgumentKey
     * @param text String text
     */
    public void typeArgumentKey(String text) {
        txtArgumentKey().typeText(text);
    }

    /** clicks on "OK" JButton
     */
    public void ok() {
        btOK().push();
    }

    /** clicks on "Cancel" JButton
     */
    public void cancel() {
        btCancel().push();
    }

    /** clicks on "Help" JButton
     */
    public void help() {
        btHelp().push();
    }


    //*****************************************
    // High-level functionality definition part
    //*****************************************

    /** Performs verification of ExternalCompilerOperator by accessing all its components.
     */
    public void verify() {
        lblProcess();
        txtProcess();
        btJButton();
        lblArguments();
        txtArguments();
        btMetalScrollButton();
        btMetalScrollButton2();
        lblArgumentKey();
        txtArgumentKey();
        btOK();
        btCancel();
        btHelp();
    }

    /** Performs simple test of ExternalCompilerOperator
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        new ExternalCompilerOperator().verify();
        System.out.println("ExternalCompilerOperator verification finished."); //NO18N
    }
}
... 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.