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

/*
 * OverrideMethodsOperator.java
 *
 * Created on 10/16/02 4:38 PM
 */
package org.netbeans.jellytools.modules.java;

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

/** Class implementing all necessary methods for handling "Override Methods in Class org.netbeans.jellytools.modules.java.OverrideMethodsCustomizer" NbDialog.
 *
 * @author jb105785
 * @version 1.0
 */
public class OverrideMethodsOperator extends JDialogOperator {
    
    /** Creates new OverrideMethodsOperator that can handle it.
     */
    public OverrideMethodsOperator() {
        super(org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("LBL_OverridePanel2_Title"));
    }
    
    private JListOperator _lstListOfAllInheritedClasses;
    private JButtonOperator _btMetalScrollButton;
    private JButtonOperator _btMetalScrollButton2;
    private JButtonOperator _btSelectAll;
    private JListOperator _lstListOfAvailableMethods;
    private JCheckBoxOperator _cbInherited;
    private JCheckBoxOperator _cbOnlyAbstract;
    private JButtonOperator _btSelectAll2;
    private JButtonOperator _btAdd;
    private JListOperator _lstListOfSelectedMethods;
    private JButtonOperator _btMetalScrollButton3;
    private JButtonOperator _btMetalScrollButton4;
    private JButtonOperator _btRemove;
    private JCheckBoxOperator _cbGenerateSuperCalls;
    private JButtonOperator _btOK;
    private JButtonOperator _btCancel;
    private JButtonOperator _btHelp;
    
    
    //******************************
    // Subcomponents definition part
    //******************************
    
    /** Tries to find null ListView$NbList in this dialog.
     * @return JListOperator
     */
    public JListOperator lstListOfAllInheritedClasses() {
        if (_lstListOfAllInheritedClasses==null) {
            _lstListOfAllInheritedClasses = new JListOperator(this);
        }
        return _lstListOfAllInheritedClasses;
    }
    
    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton() {
        if (_btMetalScrollButton==null) {
            _btMetalScrollButton = new JButtonOperator(this, ""); //NOI18N
        }
        return _btMetalScrollButton;
    }
    
    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton2() {
        if (_btMetalScrollButton2==null) {
            _btMetalScrollButton2 = new JButtonOperator(this, "", 1); //NOI18N
        }
        return _btMetalScrollButton2;
    }
    
    /** Tries to find "Select All" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btSelectAll() {
        if (_btSelectAll==null) {
            _btSelectAll = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_SelectAllAvailableMethods"));
        }
        return _btSelectAll;
    }
    
    /** Tries to find null JList in this dialog.
     * @return JListOperator
     */
    public JListOperator lstListOfAvailableMethods() {
        if (_lstListOfAvailableMethods==null) {
            _lstListOfAvailableMethods = new JListOperator(this, 1);
        }
        return _lstListOfAvailableMethods;
    }
    
    /** Tries to find "Inherited" JCheckBox in this dialog.
     * @return JCheckBoxOperator
     */
    public JCheckBoxOperator cbInherited() {
        if (_cbInherited==null) {
            _cbInherited = new JCheckBoxOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_ShowInheritedMethods"));
        }
        return _cbInherited;
    }
    
    /** Tries to find "Only Abstract" JCheckBox in this dialog.
     * @return JCheckBoxOperator
     */
    public JCheckBoxOperator cbOnlyAbstract() {
        if (_cbOnlyAbstract==null) {
            _cbOnlyAbstract = new JCheckBoxOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_ShowOnlyAbstractMethods"));
        }
        return _cbOnlyAbstract;
    }
    
    /** Tries to find "Select All" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btSelectAll2() {
        if (_btSelectAll2==null) {
            _btSelectAll2 = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_SelectAllAncestors"),1);
        }
        return _btSelectAll2;
    }
    
    /** Tries to find "Add" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btAdd() {
        if (_btAdd==null) {
            _btAdd = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_OverrideMethod"));
        }
        return _btAdd;
    }
    
    /** Tries to find null JList in this dialog.
     * @return JListOperator
     */
    public JListOperator lstListOfSelectedMethods() {
        if (_lstListOfSelectedMethods==null) {
            _lstListOfSelectedMethods = new JListOperator(this, 2);
        }
        return _lstListOfSelectedMethods;
    }
    
    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton3() {
        if (_btMetalScrollButton3==null) {
            _btMetalScrollButton3 = new JButtonOperator(this, "", 5);
        }
        return _btMetalScrollButton3;
    }
    
    /** Tries to find "" MetalScrollButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btMetalScrollButton4() {
        if (_btMetalScrollButton4==null) {
            _btMetalScrollButton4 = new JButtonOperator(this, "", 6);
        }
        return _btMetalScrollButton4;
    }
    
    /** Tries to find "Remove" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btRemove() {
        if (_btRemove==null) {
            _btRemove = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_RemoveOverridenMethod"));
        }
        return _btRemove;
    }
    
    /** Tries to find "Generate Super Calls" JCheckBox in this dialog.
     * @return JCheckBoxOperator
     */
    public JCheckBoxOperator cbGenerateSuperCalls() {
        if (_cbGenerateSuperCalls==null) {
            _cbGenerateSuperCalls = new JCheckBoxOperator(this, org.openide.util.NbBundle.getBundle("org.netbeans.modules.java.tools.Bundle").getString("BTN_GenerateSuperCall"));
        }
        return _cbGenerateSuperCalls;
    }
    
    /** Tries to find "OK" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btOK() {
        if (_btOK==null) {
            _btOK = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.openide.Bundle").getString("CTL_OK"));
        }
        return _btOK;
    }
    
    /** Tries to find "Cancel" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btCancel() {
        if (_btCancel==null) {
            _btCancel = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.openide.Bundle").getString("CTL_CANCEL"));
        }
        return _btCancel;
    }
    
    /** Tries to find "Help" JButton in this dialog.
     * @return JButtonOperator
     */
    public JButtonOperator btHelp() {
        if (_btHelp==null) {
            _btHelp = new JButtonOperator(this, org.openide.util.NbBundle.getBundle("org.openide.Bundle").getString("CTL_HelpName"));
        }
        return _btHelp;
    }
    
    
    //****************************************
    // Low-level functionality definition part
    //****************************************
    
    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton() {
        btMetalScrollButton().push();
    }
    
    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton2() {
        btMetalScrollButton2().push();
    }
    
    /** clicks on "Select All" JButton
     */
    public void selectAll() {
        btSelectAll().push();
    }
    
    /** checks or unchecks given JCheckBox
     * @param state boolean requested state
     */
    public void checkInherited(boolean state) {
        if (cbInherited().isSelected()!=state) {
            cbInherited().push();
        }
    }
    
    /** checks or unchecks given JCheckBox
     * @param state boolean requested state
     */
    public void checkOnlyAbstract(boolean state) {
        if (cbOnlyAbstract().isSelected()!=state) {
            cbOnlyAbstract().push();
        }
    }
    
    /** clicks on "Select All" JButton
     */
    public void selectAll2() {
        btSelectAll2().push();
    }
    
    /** clicks on "Add" JButton
     */
    public void add() {
        btAdd().push();
    }
    
    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton3() {
        btMetalScrollButton3().push();
    }
    
    /** clicks on "" MetalScrollButton
     */
    public void metalScrollButton4() {
        btMetalScrollButton4().push();
    }
    
    /** clicks on "Remove" JButton
     */
    public void remove() {
        btRemove().push();
    }
    
    /** checks or unchecks given JCheckBox
     * @param state boolean requested state
     */
    public void checkGenerateSuperCalls(boolean state) {
        if (cbGenerateSuperCalls().isSelected()!=state) {
            cbGenerateSuperCalls().push();
        }
    }
    
    /** 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 OverrideMethodsOperator by accessing all its components.
     */
    public void verify() {
        lstListOfAllInheritedClasses();
        btMetalScrollButton();
        btMetalScrollButton2();
        btSelectAll();
        lstListOfAvailableMethods();
        cbInherited();
        cbOnlyAbstract();
        btSelectAll2();
        btAdd();
        lstListOfSelectedMethods();
        btMetalScrollButton3();
        btMetalScrollButton4();
        btRemove();
        cbGenerateSuperCalls();
        btOK();
        btCancel();
        btHelp();
    }
    
    /** Performs simple test of OverrideMethodsOperator
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new OverrideMethodsOperator().verify();
        System.out.println("OverrideMethodsOperator 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.