Source Code Cross Referenced for AttachDialogOperator.java in  » IDE-Netbeans » jellytools » org » netbeans » jellytools » modules » debugger » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » jellytools » org.netbeans.jellytools.modules.debugger 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package org.netbeans.jellytools.modules.debugger;
042:
043:        import javax.swing.JComboBox;
044:        import javax.swing.JTextField;
045:        import org.netbeans.jellytools.Bundle;
046:        import org.netbeans.jellytools.NbDialogOperator;
047:        import org.netbeans.jellytools.modules.debugger.actions.AttachDebuggerAction;
048:        import org.netbeans.jemmy.operators.JComboBoxOperator;
049:        import org.netbeans.jemmy.operators.JLabelOperator;
050:        import org.netbeans.jemmy.operators.JTextFieldOperator;
051:        import org.netbeans.jemmy.operators.Operator;
052:
053:        /** Class implementing all necessary methods for handling "Attach" Dialog.
054:         *
055:         * @author Jiri.Skrivanek@sun.com
056:         */
057:        public class AttachDialogOperator extends NbDialogOperator {
058:
059:            private JLabelOperator _lblDebugger;
060:            private JComboBoxOperator _cboDebugger;
061:            private JLabelOperator _lblConnector;
062:            private JComboBoxOperator _cboConnector;
063:            /** SocketAttach (Attaches by socket to other VMs) item. */
064:            public static final String ITEM_SOCKET_ATTACH = "SocketAttach (Attaches by socket to other VMs)"; //NOI18N
065:            /** SharedMemoryAttach (Attaches by shared memory to other VMs) item. */
066:            public static final String ITEM_SHARED_MEMORY_ATTACH = "SharedMemoryAttach (Attaches by shared memory to other VMs)"; //NOI18N
067:            /** SocketListen (Accepts socket connections initiated by other VMs) item. */
068:            public static final String ITEM_SOCKET_LISTEN = "SocketListen (Accepts socket connections initiated by other VMs)"; //NOI18N
069:            /** SharedMemoryListen (Accepts shared memory connections initiated by other VMs) item. */
070:            public static final String ITEM_SHARED_MEMORY_LISTEN = "SharedMemoryListen (Accepts shared memory connections initiated by other VMs)"; //NOI18N
071:            private JLabelOperator _lblTransport;
072:            private JTextFieldOperator _txtTransport;
073:            private JLabelOperator _lblName;
074:            private JTextFieldOperator _txtName;
075:            private JLabelOperator _lblTimeoutMs;
076:            private JTextFieldOperator _txtTimeoutMs;
077:            private JLabelOperator _lblPort;
078:            private JTextFieldOperator _txtPort;
079:            private JLabelOperator _lblHost;
080:            private JTextFieldOperator _txtHost;
081:
082:            /** Waits for dialog with Attach title and creates AttachDialogOperator. */
083:            public AttachDialogOperator() {
084:                super (Bundle.getString(
085:                        "org.netbeans.modules.debugger.ui.actions.Bundle",
086:                        "CTL_Connect_to_running_process"));
087:            }
088:
089:            /** Opens Attach dialog and returns instance of AttachDialogOperator.
090:             * @return AttachDialogOperator instance
091:             */
092:            public static AttachDialogOperator invoke() {
093:                new AttachDebuggerAction().perform();
094:                return new AttachDialogOperator();
095:            }
096:
097:            //******************************
098:            // Subcomponents definition part
099:            //******************************
100:
101:            /** Tries to find "Debugger:" JLabel in this dialog.
102:             * @return JLabelOperator
103:             */
104:            public JLabelOperator lblDebugger() {
105:                if (_lblDebugger == null) {
106:                    _lblDebugger = new JLabelOperator(
107:                            this ,
108:                            Bundle
109:                                    .getStringTrimmed(
110:                                            "org.netbeans.modules.debugger.ui.actions.Bundle",
111:                                            "CTL_Connect_through"));
112:                }
113:                return _lblDebugger;
114:            }
115:
116:            /** Tries to find Debugger JComboBox in this dialog.
117:             * @return JComboBoxOperator
118:             */
119:            public JComboBoxOperator cboDebugger() {
120:                if (_cboDebugger == null) {
121:                    _cboDebugger = new JComboBoxOperator(
122:                            (JComboBox) lblDebugger().getLabelFor());
123:                }
124:                return _cboDebugger;
125:            }
126:
127:            /** Tries to find "Connector:" JLabel in this dialog.
128:             * @return JLabelOperator
129:             */
130:            public JLabelOperator lblConnector() {
131:                if (_lblConnector == null) {
132:                    _lblConnector = new JLabelOperator(
133:                            this ,
134:                            Bundle
135:                                    .getStringTrimmed(
136:                                            "org.netbeans.modules.debugger.jpda.ui.Bundle",
137:                                            "CTL_Connector"));
138:                }
139:                return _lblConnector;
140:            }
141:
142:            /** Tries to find Connector JComboBox in this dialog.
143:             * @return JComboBoxOperator
144:             */
145:            public JComboBoxOperator cboConnector() {
146:                if (_cboConnector == null) {
147:                    _cboConnector = new JComboBoxOperator(
148:                            (JComboBox) lblConnector().getLabelFor());
149:                }
150:                return _cboConnector;
151:            }
152:
153:            /** Tries to find "Transport:" JLabel in this dialog.
154:             * @return JLabelOperator
155:             */
156:            public JLabelOperator lblTransport() {
157:                if (_lblTransport == null) {
158:                    _lblTransport = new JLabelOperator(
159:                            this ,
160:                            Bundle
161:                                    .getStringTrimmed(
162:                                            "org.netbeans.modules.debugger.jpda.ui.Bundle",
163:                                            "CTL_Transport"));
164:                }
165:                return _lblTransport;
166:            }
167:
168:            /** Tries to find Transport JTextField in this dialog.
169:             * @return JTextFieldOperator
170:             */
171:            public JTextFieldOperator txtTransport() {
172:                if (_txtTransport == null) {
173:                    _txtTransport = new JTextFieldOperator(
174:                            (JTextField) lblTransport().getLabelFor());
175:                }
176:                return _txtTransport;
177:            }
178:
179:            /** Tries to find "Name:" JLabel in this dialog.
180:             * @return JLabelOperator
181:             */
182:            public JLabelOperator lblName() {
183:                if (_lblName == null) {
184:                    _lblName = new JLabelOperator(
185:                            this ,
186:                            Bundle
187:                                    .getStringTrimmed(
188:                                            "org.netbeans.modules.debugger.jpda.ui.Bundle",
189:                                            "CTL_CA_name"));
190:                }
191:                return _lblName;
192:            }
193:
194:            /** Tries to find Name JTextField in this dialog.
195:             * @return JTextFieldOperator
196:             */
197:            public JTextFieldOperator txtName() {
198:                if (_txtName == null) {
199:                    _txtName = new JTextFieldOperator((JTextField) lblName()
200:                            .getLabelFor());
201:                }
202:                return _txtName;
203:            }
204:
205:            /** Tries to find "Timeout [ms]:" JLabel in this dialog.
206:             * @return JLabelOperator
207:             */
208:            public JLabelOperator lblTimeout() {
209:                if (_lblTimeoutMs == null) {
210:                    _lblTimeoutMs = new JLabelOperator(
211:                            this ,
212:                            Bundle
213:                                    .getStringTrimmed(
214:                                            "org.netbeans.modules.debugger.jpda.ui.Bundle",
215:                                            "CTL_CA_timeout"));
216:                }
217:                return _lblTimeoutMs;
218:            }
219:
220:            /** Tries to find Timeout JTextField in this dialog.
221:             * @return JTextFieldOperator
222:             */
223:            public JTextFieldOperator txtTimeout() {
224:                if (_txtTimeoutMs == null) {
225:                    _txtTimeoutMs = new JTextFieldOperator(
226:                            (JTextField) lblTimeout().getLabelFor());
227:                }
228:                return _txtTimeoutMs;
229:            }
230:
231:            /** Tries to find "Host:" JLabel in this dialog.
232:             * @return JLabelOperator
233:             */
234:            public JLabelOperator lblHost() {
235:                if (_lblHost == null) {
236:                    _lblHost = new JLabelOperator(
237:                            this ,
238:                            Bundle
239:                                    .getStringTrimmed(
240:                                            "org.netbeans.modules.debugger.jpda.ui.Bundle",
241:                                            "CTL_CA_hostname"));
242:                }
243:                return _lblHost;
244:            }
245:
246:            /** Tries to find Host JTextField in this dialog.
247:             * @return JTextFieldOperator
248:             */
249:            public JTextFieldOperator txtHost() {
250:                if (_txtHost == null) {
251:                    _txtHost = new JTextFieldOperator((JTextField) lblHost()
252:                            .getLabelFor());
253:                }
254:                return _txtHost;
255:            }
256:
257:            /** Tries to find "Port:" JLabel in this dialog.
258:             * @return JLabelOperator
259:             */
260:            public JLabelOperator lblPort() {
261:                if (_lblPort == null) {
262:                    Operator.StringComparator old = getComparator();
263:                    try {
264:                        // set exact comparator because port vs. trasport clash
265:                        setComparator(new DefaultStringComparator(true, true));
266:                        _lblPort = new JLabelOperator(
267:                                this ,
268:                                Bundle
269:                                        .getStringTrimmed(
270:                                                "org.netbeans.modules.debugger.jpda.ui.Bundle",
271:                                                "CTL_CA_port"));
272:                    } finally {
273:                        setComparator(old);
274:                    }
275:                }
276:                return _lblPort;
277:            }
278:
279:            /** Tries to find Port JTextField in this dialog.
280:             * @return JTextFieldOperator
281:             */
282:            public JTextFieldOperator txtPort() {
283:                if (_txtPort == null) {
284:                    _txtPort = new JTextFieldOperator((JTextField) lblPort()
285:                            .getLabelFor());
286:                }
287:                return _txtPort;
288:            }
289:
290:            //****************************************
291:            // Low-level functionality definition part
292:            //****************************************
293:
294:            /** returns selected item for cboDebugger
295:             * @return String item
296:             */
297:            public String getSelectedDebugger() {
298:                return cboDebugger().getSelectedItem().toString();
299:            }
300:
301:            /** selects item for cboDebugger
302:             * @param item String item
303:             */
304:            public void selectDebugger(String item) {
305:                cboDebugger().selectItem(item);
306:            }
307:
308:            /** returns selected item for cboConnector
309:             * @return String item
310:             */
311:            public String getSelectedConnector() {
312:                return cboConnector().getSelectedItem().toString();
313:            }
314:
315:            /** selects item for cboConnector
316:             * @param item String item
317:             */
318:            public void selectConnector(String item) {
319:                cboConnector().selectItem(item);
320:            }
321:
322:            /** gets text for Transport text field
323:             * @return String text
324:             */
325:            public String getTransport() {
326:                return txtTransport().getText();
327:            }
328:
329:            /** gets text for txtName
330:             * @return String text
331:             */
332:            public String getName() {
333:                return txtName().getText();
334:            }
335:
336:            /** sets text for Name text field
337:             * @param text String text
338:             */
339:            public void setName(String text) {
340:                txtName().clearText();
341:                txtName().typeText(text);
342:            }
343:
344:            /** gets text for Timeout text field
345:             * @return String text
346:             */
347:            public String getTimeout() {
348:                return txtTimeout().getText();
349:            }
350:
351:            /** sets text for txtTimeoutMs
352:             * @param text String text
353:             */
354:            public void setTimeout(String text) {
355:                txtTimeout().clearText();
356:                txtTimeout().typeText(text);
357:            }
358:
359:            /** gets text for Host text field
360:             * @return String text
361:             */
362:            public String getHost() {
363:                return txtHost().getText();
364:            }
365:
366:            /** sets text for Host
367:             * @param text String text
368:             */
369:            public void setHost(String text) {
370:                txtHost().clearText();
371:                txtHost().typeText(text);
372:            }
373:
374:            /** gets text for Port text field
375:             * @return String text
376:             */
377:            public String getPort() {
378:                return txtPort().getText();
379:            }
380:
381:            /** sets text for Port
382:             * @param text String text
383:             */
384:            public void setPort(String text) {
385:                txtPort().clearText();
386:                txtPort().typeText(text);
387:            }
388:
389:            //*****************************************
390:            // High-level functionality definition part
391:            //*****************************************
392:
393:            /** Performs verification of AttachDialogOperator by accessing all its components.
394:             */
395:            public void verify() {
396:                lblDebugger();
397:                cboDebugger();
398:                lblConnector();
399:                cboConnector();
400:                lblTransport();
401:                txtTransport();
402:                lblTimeout();
403:                txtTimeout();
404:            }
405:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.