Source Code Cross Referenced for SwitchToBranchOperator.java in  » IDE-Netbeans » jellytools » org » netbeans » jellytools » modules » javacvs » 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.javacvs 
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-2006 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.javacvs;
042:
043:        import org.netbeans.jellytools.Bundle;
044:        import org.netbeans.jellytools.NbDialogOperator;
045:        import org.netbeans.jellytools.modules.javacvs.actions.SwitchToBranchAction;
046:        import org.netbeans.jellytools.nodes.Node;
047:        import org.netbeans.jemmy.operators.JButtonOperator;
048:        import org.netbeans.jemmy.operators.JRadioButtonOperator;
049:        import org.netbeans.jemmy.operators.JTextFieldOperator;
050:
051:        /** Class implementing all necessary methods for handling "Switch to Branch" dialog.
052:         * It is opened from main menu or from popup on versioned file.
053:         * <br>
054:         * Usage:<br>
055:         * <pre>
056:         *      Node node = new Node(new SourcePackagesNode("MyProject"), "mypackage|MyFile");
057:         *      SwitchToBranchOperator stbo = SwitchToBranchOperator.invoke(node);
058:         *      stbo.switchToBranch();
059:         *      BrowseTagsOperator bto = stbo.browse();
060:         *      bto.selectBranch("mybranch");
061:         *      bto.ok();
062:         *      // or stbo.setBranch("mybranch");
063:         *      stbo.pushSwitch();
064:         *</pre>
065:         *
066:         * @see BrowseTagsOperator
067:         * @see org.netbeans.jellytools.modules.javacvs.actions.SwitchToBranchAction
068:         *
069:         * @author Jiri.Skrivanek@sun.com
070:         */
071:        public class SwitchToBranchOperator extends NbDialogOperator {
072:
073:            /** Waits for dialog with title "Switch to Branch". */
074:            public SwitchToBranchOperator() {
075:                super (
076:                        Bundle
077:                                .getStringTrimmed(
078:                                        "org.netbeans.modules.versioning.system.cvss.ui.actions.tag.Bundle",
079:                                        "CTL_SwitchBranchDialog_Title"));
080:            }
081:
082:            /** Selects nodes and call switch to branch action on them.
083:             * @param nodes an array of nodes
084:             * @return SwitchToBranchOperator instance
085:             */
086:            public static SwitchToBranchOperator invoke(Node[] nodes) {
087:                new SwitchToBranchAction().perform(nodes);
088:                return new SwitchToBranchOperator();
089:            }
090:
091:            /** Selects node and call switch to branch action on it.
092:             * @param node node to be selected
093:             * @return SwitchToBranchOperator instance
094:             */
095:            public static SwitchToBranchOperator invoke(Node node) {
096:                return invoke(new Node[] { node });
097:            }
098:
099:            private JRadioButtonOperator _rbSwitchToTrunk;
100:            private JRadioButtonOperator _rbSwitchToBranch;
101:            private JTextFieldOperator _txtJTextField;
102:            private JButtonOperator _btBrowse;
103:            private JButtonOperator _btSwitch;
104:
105:            //******************************
106:            // Subcomponents definition part
107:            //******************************
108:
109:            /** Tries to find "Switch to Trunk" JRadioButton in this dialog.
110:             * @return JRadioButtonOperator
111:             */
112:            public JRadioButtonOperator rbSwitchToTrunk() {
113:                if (_rbSwitchToTrunk == null) {
114:                    _rbSwitchToTrunk = new JRadioButtonOperator(
115:                            this ,
116:                            org.netbeans.jellytools.Bundle
117:                                    .getStringTrimmed(
118:                                            "org.netbeans.modules.versioning.system.cvss.ui.actions.tag.Bundle",
119:                                            "CTL_SwitchBranchForm_ToTrunk"));
120:                }
121:                return _rbSwitchToTrunk;
122:            }
123:
124:            /** Tries to find "Switch to Branch:" JRadioButton in this dialog.
125:             * @return JRadioButtonOperator
126:             */
127:            public JRadioButtonOperator rbSwitchToBranch() {
128:                if (_rbSwitchToBranch == null) {
129:                    _rbSwitchToBranch = new JRadioButtonOperator(
130:                            this ,
131:                            org.netbeans.jellytools.Bundle
132:                                    .getStringTrimmed(
133:                                            "org.netbeans.modules.versioning.system.cvss.ui.actions.tag.Bundle",
134:                                            "CTL_SwitchBranchForm_ToBranch"));
135:                }
136:                return _rbSwitchToBranch;
137:            }
138:
139:            /** Tries to find Switch to branch text field in this dialog.
140:             * @return JTextFieldOperator
141:             */
142:            public JTextFieldOperator txtSwitchToBranch() {
143:                if (_txtJTextField == null) {
144:                    _txtJTextField = new JTextFieldOperator(this );
145:                }
146:                return _txtJTextField;
147:            }
148:
149:            /** Tries to find "Browse..." JButton in this dialog.
150:             * @return JButtonOperator
151:             */
152:            public JButtonOperator btBrowse() {
153:                if (_btBrowse == null) {
154:                    _btBrowse = new JButtonOperator(
155:                            this ,
156:                            org.netbeans.jellytools.Bundle
157:                                    .getStringTrimmed(
158:                                            "org.netbeans.modules.versioning.system.cvss.ui.actions.tag.Bundle",
159:                                            "CTL_SwitchBranchForm_BrowseBranch"));
160:                }
161:                return _btBrowse;
162:            }
163:
164:            /** Tries to find "Switch" JButton in this dialog.
165:             * @return JButtonOperator
166:             */
167:            public JButtonOperator btSwitch() {
168:                if (_btSwitch == null) {
169:                    _btSwitch = new JButtonOperator(
170:                            this ,
171:                            org.netbeans.jellytools.Bundle
172:                                    .getStringTrimmed(
173:                                            "org.netbeans.modules.versioning.system.cvss.ui.actions.tag.Bundle",
174:                                            "CTL_SwitchBranchDialog_Action_Switch"));
175:                }
176:                return _btSwitch;
177:            }
178:
179:            //****************************************
180:            // Low-level functionality definition part
181:            //****************************************
182:
183:            /** clicks on "Switch to Trunk" JRadioButton
184:             */
185:            public void switchToTrunk() {
186:                rbSwitchToTrunk().push();
187:            }
188:
189:            /** clicks on "Switch to Branch:" JRadioButton
190:             */
191:            public void switchToBranch() {
192:                rbSwitchToBranch().push();
193:            }
194:
195:            /** gets text from Switch to branch text field
196:             * @return String text
197:             */
198:            public String getBranch() {
199:                return txtSwitchToBranch().getText();
200:            }
201:
202:            /** sets text for Switch to Branch text field
203:             * @param text String text
204:             */
205:            public void setBranch(String text) {
206:                txtSwitchToBranch().clearText();
207:                txtSwitchToBranch().typeText(text);
208:            }
209:
210:            /** clicks on "Browse..." JButton and return BrowseTagsOperator.
211:             * @return BrowseTagsOperator instance
212:             */
213:            public BrowseTagsOperator browse() {
214:                btBrowse().pushNoBlock();
215:                return new BrowseTagsOperator();
216:            }
217:
218:            /** clicks on "Switch" JButton
219:             */
220:            public void pushSwitch() {
221:                btSwitch().push();
222:            }
223:
224:            //*****************************************
225:            // High-level functionality definition part
226:            //*****************************************
227:
228:            /** Performs verification of SwitchToBranchOperator by accessing all its components.
229:             */
230:            public void verify() {
231:                rbSwitchToTrunk();
232:                rbSwitchToBranch();
233:                txtSwitchToBranch();
234:                btBrowse();
235:                btSwitch();
236:            }
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.