Source Code Cross Referenced for JavaWSDLOptionsPage.java in  » Web-Services-AXIS2 » tools » org » apache » axis2 » tool » codegen » eclipse » ui » 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.tool.codegen.eclipse.ui 
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.tool.codegen.eclipse.ui;
020:
021:        import org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
022:        import org.apache.axis2.tool.codegen.eclipse.util.NamespaceFinder;
023:        import org.eclipse.swt.SWT;
024:        import org.eclipse.swt.events.ModifyEvent;
025:        import org.eclipse.swt.events.ModifyListener;
026:        import org.eclipse.swt.layout.GridData;
027:        import org.eclipse.swt.layout.GridLayout;
028:        import org.eclipse.swt.widgets.Composite;
029:        import org.eclipse.swt.widgets.Label;
030:        import org.eclipse.swt.widgets.Text;
031:
032:        /*
033:         * Usage java2wsdl -cn <fully qualified class name> : class file name -o <output
034:         * Location> : output file location -cp <class path uri> : list of classpath
035:         * entries - (urls) -tn <target namespace> : target namespace -tp <target
036:         * namespace prefix> : target namespace prefix -stn <schema target namespace> :
037:         * target namespace for schema -stp <schema target namespace prefix> : target
038:         * namespace prefix for schema -sn <service name> : service name -of <output
039:         * file name> : output file name for the WSDL
040:         */
041:        public class JavaWSDLOptionsPage extends AbstractWizardPage {
042:
043:            private Text targetNamespaceText;
044:
045:            private Text targetNamespacePrefixText;
046:
047:            private Text schemaTargetNamepaceText;
048:
049:            private Text schemaTargetNamespacePrefixText;
050:
051:            private Text serviceNameText;
052:
053:            // TODO need more here
054:
055:            /*
056:             * (non-Javadoc)
057:             * 
058:             * @see org.apache.axis2.tool.codegen.eclipse.ui.AbstractWizardPage#initializeDefaultSettings()
059:             */
060:            protected void initializeDefaultSettings() {
061:                settings.put(PREF_JAVA_TARGET_NS, "");
062:                settings.put(PREF_JAVA_TARGET_NS_PREF, "");
063:                settings.put(PREF_JAVA_SCHEMA_TARGET_NS, "");
064:                settings.put(PREF_JAVA_SCHEMA_TARGET_NS_PREF, "");
065:                settings.put(PREF_JAVA_SERVICE_NAME, "");
066:
067:            }
068:
069:            public void setNamespaceDefaults(String fullyQualifiedClassName) {
070:
071:                targetNamespaceText.setText(NamespaceFinder
072:                        .getTargetNamespaceFromClass(fullyQualifiedClassName));
073:                schemaTargetNamepaceText
074:                        .setText(NamespaceFinder
075:                                .getSchemaTargetNamespaceFromClass(fullyQualifiedClassName));
076:
077:                targetNamespacePrefixText.setText(NamespaceFinder
078:                        .getDefaultNamespacePrefix());
079:                schemaTargetNamespacePrefixText.setText(NamespaceFinder
080:                        .getDefaultSchemaNamespacePrefix());
081:
082:                //		serviceNameText.setText(fullyQualifiedClassName.replaceAll("\\.","_"));
083:                serviceNameText.setText(NamespaceFinder
084:                        .getServiceNameText(fullyQualifiedClassName));
085:            }
086:
087:            /**
088:             * @param pageName
089:             */
090:            public JavaWSDLOptionsPage() {
091:                super ("page5");
092:
093:            }
094:
095:            /*
096:             * (non-Javadoc)
097:             * 
098:             * @see org.apache.axis2.tool.codegen.eclipse.ui.CodegenPage#getPageType()
099:             */
100:            public int getPageType() {
101:                return JAVA_2_WSDL_TYPE;
102:            }
103:
104:            /*
105:             * (non-Javadoc)
106:             * 
107:             * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
108:             */
109:            public void createControl(Composite parent) {
110:                Composite container = new Composite(parent, SWT.NULL);
111:                GridLayout layout = new GridLayout();
112:                container.setLayout(layout);
113:                layout.numColumns = 2;
114:                layout.verticalSpacing = 9;
115:
116:                GridData gd = new GridData(GridData.FILL_HORIZONTAL);
117:                Label label = new Label(container, SWT.NULL);
118:                label.setText(CodegenWizardPlugin
119:                        .getResourceString("page5.targetNamespace.label"));
120:
121:                targetNamespaceText = new Text(container, SWT.BORDER
122:                        | SWT.SINGLE);
123:                targetNamespaceText.setLayoutData(gd);
124:                targetNamespaceText.setText(settings.get(PREF_JAVA_TARGET_NS));
125:                targetNamespaceText.addModifyListener(new ModifyListener() {
126:                    public void modifyText(ModifyEvent e) {
127:                        settings.put(PREF_JAVA_TARGET_NS, targetNamespaceText
128:                                .getText());
129:                        // dialogChanged();
130:                    }
131:                });
132:
133:                label = new Label(container, SWT.NULL);
134:                label
135:                        .setText(CodegenWizardPlugin
136:                                .getResourceString("page5.targetNamespacePrefix.label"));
137:
138:                gd = new GridData(GridData.FILL_HORIZONTAL);
139:                targetNamespacePrefixText = new Text(container, SWT.BORDER);
140:                targetNamespacePrefixText.setLayoutData(gd);
141:                targetNamespacePrefixText.setText(settings
142:                        .get(PREF_JAVA_TARGET_NS_PREF));
143:                targetNamespacePrefixText
144:                        .addModifyListener(new ModifyListener() {
145:                            public void modifyText(ModifyEvent e) {
146:                                settings.put(PREF_JAVA_TARGET_NS_PREF,
147:                                        targetNamespacePrefixText.getText());
148:                                // dialogChanged();
149:                            }
150:                        });
151:
152:                label = new Label(container, SWT.NULL);
153:                label.setText(CodegenWizardPlugin
154:                        .getResourceString("page5.schemaTargetNs.label"));
155:
156:                gd = new GridData(GridData.FILL_HORIZONTAL);
157:                schemaTargetNamepaceText = new Text(container, SWT.BORDER);
158:                schemaTargetNamepaceText.setLayoutData(gd);
159:                schemaTargetNamepaceText.setText(settings
160:                        .get(PREF_JAVA_SCHEMA_TARGET_NS_PREF));
161:                schemaTargetNamepaceText
162:                        .addModifyListener(new ModifyListener() {
163:                            public void modifyText(ModifyEvent e) {
164:                                settings.put(PREF_JAVA_SCHEMA_TARGET_NS_PREF,
165:                                        schemaTargetNamepaceText.getText());
166:                                // dialogChanged();
167:                            }
168:                        });
169:
170:                label = new Label(container, SWT.NULL);
171:                label.setText(CodegenWizardPlugin
172:                        .getResourceString("page5.schemaTargetNsPrefix.label"));
173:
174:                gd = new GridData(GridData.FILL_HORIZONTAL);
175:                schemaTargetNamespacePrefixText = new Text(container,
176:                        SWT.BORDER);
177:                schemaTargetNamespacePrefixText.setLayoutData(gd);
178:                schemaTargetNamespacePrefixText.setText(settings
179:                        .get(PREF_JAVA_SCHEMA_TARGET_NS));
180:                schemaTargetNamespacePrefixText
181:                        .addModifyListener(new ModifyListener() {
182:                            public void modifyText(ModifyEvent e) {
183:                                settings.put(PREF_JAVA_SCHEMA_TARGET_NS,
184:                                        schemaTargetNamespacePrefixText
185:                                                .getText());
186:                                // dialogChanged();
187:                            }
188:                        });
189:
190:                label = new Label(container, SWT.NULL);
191:                label.setText(CodegenWizardPlugin
192:                        .getResourceString("page5.serviceName.label"));
193:
194:                gd = new GridData(GridData.FILL_HORIZONTAL);
195:                serviceNameText = new Text(container, SWT.BORDER);
196:                serviceNameText.setLayoutData(gd);
197:                serviceNameText.setText(settings
198:                        .get(PREF_JAVA_SCHEMA_TARGET_NS));
199:                serviceNameText.addModifyListener(new ModifyListener() {
200:                    public void modifyText(ModifyEvent e) {
201:                        settings.put(PREF_JAVA_SERVICE_NAME, serviceNameText
202:                                .getText());
203:                        dialogChanged();
204:                    }
205:                });
206:
207:                setControl(container);
208:
209:            }
210:
211:            public String getTargetNamespace() {
212:                return this .targetNamespaceText.getText();
213:            }
214:
215:            public String getTargetNamespacePrefix() {
216:                return this .targetNamespacePrefixText.getText();
217:            }
218:
219:            public String getSchemaTargetNamespace() {
220:                return this .schemaTargetNamepaceText.getText();
221:            }
222:
223:            public String getSchemaTargetNamespacePrefix() {
224:                return this .schemaTargetNamespacePrefixText.getText();
225:            }
226:
227:            public String getServiceName() {
228:                return this .serviceNameText.getText();
229:            }
230:
231:            /**
232:             * Handle the dialog change event. Basically evaluates the file name and
233:             * sets the error message accordingly
234:             */
235:            private void dialogChanged() {
236:                String fileName = getServiceName();
237:
238:                if (fileName.length() == 0) {
239:                    updateStatus(CodegenWizardPlugin
240:                            .getResourceString("page5.error.filemissingerror"));
241:                    return;
242:                }
243:                // update the status
244:                updateStatus(null);
245:            }
246:
247:        }
w_w__w_.___jav__a_2___s___.___c_o_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.