Source Code Cross Referenced for ChooserPanel.java in  » Web-Services-AXIS2 » tools » org » apache » axis2 » tools » idea » 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 » Web Services AXIS2 » tools » org.apache.axis2.tools.idea 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:        package org.apache.axis2.tools.idea;
020:
021:        import org.apache.axis2.tools.component.WizardPanel;
022:        import org.apache.axis2.tools.component.WizardComponents;
023:        import org.apache.axis2.tools.wizardframe.CodegenFrame;
024:
025:        import javax.swing.*;
026:        import javax.swing.border.EmptyBorder;
027:        import java.awt.*;
028:        import java.awt.event.ItemListener;
029:        import java.awt.event.ItemEvent;
030:        import java.awt.event.ActionListener;
031:        import java.awt.event.ActionEvent;
032:
033:        /**
034:         * this panel used for as chooser
035:         *      java2wsdl codegen option
036:         *      wsdl2java  codegen option
037:         *
038:         * extend from wizardPanel calss
039:         */
040:
041:        public class ChooserPanel extends WizardPanel {
042:            /**
043:             * varialbales
044:             */
045:            private JButton btnHint;
046:            private JLabel lblHint;
047:            private boolean flag = false;
048:            private JRadioButton optionJ2WRadioButton;
049:            private JRadioButton optionW2JRadioButton;
050:            private JRadioButton optionServiceArchiverRadioButton;
051:            private ButtonGroup bg;
052:            private char selectedOption = 'A'; // 'N' is no option selected  'A', 'B','C' & 'F' stands for options
053:            final private String hint = "You can generate java code from a WSDL or WSDL from a java source file.";
054:
055:            /**
056:             * construct method for chooserPanel
057:             *  @param wizardComponents
058:             */
059:
060:            public ChooserPanel(WizardComponents wizardComponents) {
061:
062:                super (wizardComponents, "Axis2 Idea Plugin Wizards");
063:                setPanelTopTitle("Select the wizard");
064:                setPanelBottomTitle("Welcome to the Axis2 code generator wizard");
065:                init();
066:            }
067:
068:            /**
069:             * Panel initial method
070:             */
071:            private void init() {
072:
073:                lblHint = new JLabel("");
074:                btnHint = new JButton("Hint >>");
075:                btnHint.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0)));
076:
077:                optionW2JRadioButton = new JRadioButton(
078:                        "Generate java sorce code from a WSDl file.", true);
079:                optionJ2WRadioButton = new JRadioButton(
080:                        "Generate a WSDl from a java source file", false);
081:                optionServiceArchiverRadioButton = new JRadioButton(
082:                        "Create Service Archiver", false);
083:                ButtonGroup bg = new ButtonGroup();
084:                bg.add(optionJ2WRadioButton);
085:                bg.add(optionW2JRadioButton);
086:                bg.add(optionServiceArchiverRadioButton);
087:
088:                this .setLayout(new GridBagLayout());
089:
090:                this .add(new JLabel("Please specify what you want to do."),
091:                        new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,
092:                                GridBagConstraints.NORTHWEST,
093:                                GridBagConstraints.NONE, new Insets(10, 20, 0,
094:                                        0), 0, 0));
095:
096:                // option button for java2wsdl
097:                optionW2JRadioButton.setEnabled(true);
098:                this .add(optionW2JRadioButton,
099:                        new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,
100:                                GridBagConstraints.NORTHWEST,
101:                                GridBagConstraints.NONE, new Insets(10, 20, 0,
102:                                        0), 0, 0));
103:                optionW2JRadioButton.addItemListener(new ItemListener() {
104:                    public void itemStateChanged(ItemEvent e) {
105:                        if (e.getStateChange() == ItemEvent.SELECTED) {
106:                            selectedOption = 'A';
107:                            update();
108:                        }
109:                    }
110:                });
111:
112:                // option button for wsdl2java
113:
114:                this .add(optionJ2WRadioButton,
115:                        new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0,
116:                                GridBagConstraints.NORTHWEST,
117:                                GridBagConstraints.NONE, new Insets(10, 20, 0,
118:                                        0), 0, 0));
119:                optionJ2WRadioButton.addItemListener(new ItemListener() {
120:                    public void itemStateChanged(ItemEvent e) {
121:                        if (e.getStateChange() == ItemEvent.SELECTED) {
122:                            selectedOption = 'B';
123:                            update();
124:                        }
125:                    }
126:                });
127:                // option button for service Archive
128:
129:                this .add(optionServiceArchiverRadioButton,
130:                        new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0,
131:                                GridBagConstraints.NORTHWEST,
132:                                GridBagConstraints.NONE, new Insets(10, 20, 0,
133:                                        0), 0, 0));
134:                optionServiceArchiverRadioButton
135:                        .addItemListener(new ItemListener() {
136:                            public void itemStateChanged(ItemEvent e) {
137:                                if (e.getStateChange() == ItemEvent.SELECTED) {
138:                                    selectedOption = 'C';
139:                                    update();
140:                                }
141:                            }
142:                        });
143:
144:                // hint button
145:
146:                this .add(btnHint, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
147:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
148:                        new Insets(10, 20, 0, 0), 0, 0));
149:                btnHint.addActionListener(new ActionListener() {
150:                    public void actionPerformed(ActionEvent e) {
151:                        if (flag) {
152:                            btnHint.setText("Hint >>");
153:                            lblHint.setText("");
154:                            flag = false;
155:                        } else {
156:                            btnHint.setText("Hint <<");
157:                            lblHint.setText(hint);
158:                            flag = true;
159:                        }
160:                        update();
161:                    }
162:                });
163:
164:                // hint lable
165:
166:                this .add(lblHint, new GridBagConstraints(0, 5, 1, 1, 1.0, 1.0,
167:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
168:                        new Insets(10, 20, 0, 0), 0, 0));
169:
170:                setNextButtonEnabled((selectedOption == 'A')
171:                        || (selectedOption == 'B'));
172:
173:            }
174:
175:            /**
176:             * method for update when panel has some change
177:             */
178:
179:            public void update() {
180:                setNextButtonEnabled((selectedOption == 'A')
181:                        || (selectedOption == 'B') || (selectedOption == 'C'));
182:                setBackButtonEnabled(false); // there is no way back
183:                setProgressPanelVisible(false);
184:                setPageComplete(true);
185:            }
186:
187:            /**
188:             * method for next button
189:             */
190:            public void next() {
191:                if (selectedOption == 'A') {
192:                    switchPanel(CodegenFrame.PANEL_FIRST_A);
193:
194:                } else if (selectedOption == 'B') {
195:                    switchPanel(CodegenFrame.PANEL_FIRST_B);
196:                } else if (selectedOption == 'C') {
197:                    switchPanel(CodegenFrame.PANEL_FIRST_C);
198:                }
199:                setNextButtonEnabled(false);
200:            }
201:
202:            /**
203:             * methodd for back button
204:             */
205:            public void back() {
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.