KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > qa > form > SelectPaletteCategoryOperator


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.qa.form;
21
22 import javax.swing.JDialog JavaDoc;
23 import org.netbeans.jemmy.operators.*;
24
25 /**
26  * Class implementing all necessary methods for handling "Select Palette Category" NbDialog.
27  * Most parts of code are generated by jelly tools.*
28  *
29  * @author Jiri Vagner
30  */

31 public class SelectPaletteCategoryOperator extends JDialogOperator {
32
33     private JLabelOperator _lblPaletteCategories;
34     private JListOperator _lstPaletteCategories;
35     public static final String JavaDoc ITEM_SWINGCONTAINERS = "Swing Containers"; // NOI18N
36
public static final String JavaDoc ITEM_SWINGCONTROLS = "Swing Controls"; // NOI18N
37
public static final String JavaDoc ITEM_SWINGMENUS = "Swing Menus"; // NOI18N
38
public static final String JavaDoc ITEM_SWINGWINDOWS = "Swing Windows"; // NOI18N
39
public static final String JavaDoc ITEM_AWT = "AWT"; // NOI18N
40
public static final String JavaDoc ITEM_BORDERS = "Borders"; // NOI18N
41
public static final String JavaDoc ITEM_BEANS = "Beans"; // NOI18N
42
public static final String JavaDoc ITEM_LOOKANDFEELS = "Look and Feels"; // NOI18N
43
private JButtonOperator _btOK;
44     private JButtonOperator _btCancel;
45
46     /** Creates new SelectPaletteCategory that can handle it.
47      */

48     public SelectPaletteCategoryOperator() {
49         super("Select Palette Category"); // NOI18N
50
}
51     
52     /**
53      * Creates new SelectPaletteCategory using title name
54      * @param title
55      */

56     public SelectPaletteCategoryOperator(String JavaDoc title) {
57         super(title);
58     }
59     
60     /**
61      * Creates new instance using existing JDialog operator
62      * @param wrapper
63      */

64     public SelectPaletteCategoryOperator(JDialogOperator wrapper) {
65         super((JDialog JavaDoc)wrapper.getSource());
66     }
67
68     //******************************
69
// Subcomponents definition part
70
//******************************
71

72     /** Tries to find "Palette Categories:" JLabel in this dialog.
73      * @return JLabelOperator
74      */

75     public JLabelOperator lblPaletteCategories() {
76         if (_lblPaletteCategories==null) {
77             _lblPaletteCategories = new JLabelOperator(this, "Palette Categories:"); // NOI18N
78
}
79         return _lblPaletteCategories;
80     }
81
82     /** Tries to find null ListView$NbList in this dialog.
83      * @return JListOperator
84      */

85     public JListOperator lstPaletteCategories() {
86         if (_lstPaletteCategories==null) {
87             _lstPaletteCategories = new JListOperator(this);
88         }
89         return _lstPaletteCategories;
90     }
91
92     /** Tries to find "OK" JButton in this dialog.
93      * @return JButtonOperator
94      */

95     public JButtonOperator btOK() {
96         if (_btOK==null) {
97             _btOK = new JButtonOperator(this, "OK"); // NOI18N
98
}
99         return _btOK;
100     }
101
102     /** Tries to find "Cancel" JButton in this dialog.
103      * @return JButtonOperator
104      */

105     public JButtonOperator btCancel() {
106         if (_btCancel==null) {
107             _btCancel = new JButtonOperator(this, "Cancel"); // NOI18N
108
}
109         return _btCancel;
110     }
111
112
113     //****************************************
114
// Low-level functionality definition part
115
//****************************************
116

117     /** clicks on "OK" JButton
118      */

119     public void ok() {
120         btOK().push();
121     }
122
123     /** clicks on "Cancel" JButton
124      */

125     public void cancel() {
126         btCancel().push();
127     }
128
129
130     //*****************************************
131
// High-level functionality definition part
132
//*****************************************
133

134     /** Performs verification of SelectPaletteCategory by accessing all its components.
135      */

136     public void verify() {
137         lblPaletteCategories();
138         lstPaletteCategories();
139         btOK();
140         btCancel();
141     }
142 }
143
144
Popular Tags