Source Code Cross Referenced for ServiceArchiveWizard.java in  » Web-Services-AXIS2 » tools » org » apache » axis2 » tool » service » 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.service.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.service.eclipse.ui;
020:
021:        import org.apache.axis2.tool.service.bean.WizardBean;
022:        import org.apache.axis2.tool.service.control.Controller;
023:        import org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver;
024:        import org.eclipse.core.runtime.CoreException;
025:        import org.eclipse.core.runtime.IProgressMonitor;
026:        import org.eclipse.core.runtime.NullProgressMonitor;
027:        import org.eclipse.jface.dialogs.MessageDialog;
028:        import org.eclipse.jface.viewers.IStructuredSelection;
029:        import org.eclipse.jface.wizard.IWizardPage;
030:        import org.eclipse.jface.wizard.Wizard;
031:        import org.eclipse.ui.INewWizard;
032:        import org.eclipse.ui.IWorkbench;
033:        import org.eclipse.ui.actions.WorkspaceModifyOperation;
034:
035:        import java.lang.reflect.InvocationTargetException;
036:        import java.util.List;
037:
038:        public class ServiceArchiveWizard extends Wizard implements  INewWizard {
039:
040:            private ClassFileLocationPage classFileLocationPage;
041:            private WSDLFileSelectionPage wsdlFileSelectionPage;
042:            private ServiceXMLFileSelectionPage serviceXMLFileSelectionPage;
043:            private ServiceXMLGenerationPage serviceXMLGenerationPage;
044:            private ServiceArchiveOutputLocationPage serviceArchiveOutputLocationPage;
045:            private LibraryAddingPage libPage;
046:
047:            private boolean updateServiceGenerationStatus;
048:            private String classFileLocation;
049:            private String wsdlFileGenerationStatus;
050:
051:            /**
052:             * @return Returns the wsdlFileGenerationStatus.
053:             */
054:            public String getWsdlFileGenerationStatus() {
055:                return wsdlFileGenerationStatus;
056:            }
057:
058:            /**
059:             * @param message The wsdlFileGenerationStatus to set.
060:             */
061:            public void updateWsdlFileGenerationStatus(String message) {
062:                this .wsdlFileGenerationStatus = message;
063:            }
064:
065:            public String getClassFileLocation() {
066:                return classFileLocation;
067:            }
068:
069:            //get the lib file list
070:            public String[] getLibFileList() {
071:                return libPage.getBean().getFileList();
072:            }
073:
074:            public void setClassFileLocation(String location) {
075:                this .classFileLocation = location;
076:            }
077:
078:            public void updateServiceXMLGeneration(boolean status) {
079:                serviceXMLGenerationPage.setPageComplete(status);
080:            }
081:
082:            /**
083:             * 
084:             */
085:            public ServiceArchiveWizard() {
086:                super ();
087:                setNeedsProgressMonitor(true);
088:                setWindowTitle(ServiceArchiver.getResourceString("main.title"));
089:            }
090:
091:            public boolean canFinish() {
092:                IWizardPage[] pages = getPages();
093:                AbstractServiceWizardPage wizardPage = null;
094:                for (int i = 0; i < pages.length; i++) {
095:                    wizardPage = (AbstractServiceWizardPage) pages[i];
096:                    if (wizardPage.getName().equals("page4.name")) {
097:                        if (!wizardPage.getWizardComplete()) {
098:                            return false;
099:                        }
100:                    }
101:                }
102:                return true;
103:            }
104:
105:            /* (non-Javadoc)
106:             * @see org.eclipse.jface.wizard.IWizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
107:             */
108:            public IWizardPage getNextPage(IWizardPage page) {
109:                AbstractServiceWizardPage this Page = (AbstractServiceWizardPage) page;
110:                AbstractServiceWizardPage nextPage = (AbstractServiceWizardPage) super 
111:                        .getNextPage(page);
112:                while (this Page != null && this Page.isSkipNext()) {
113:                    if (nextPage != null) {
114:                        this Page = nextPage;
115:                        nextPage = (AbstractServiceWizardPage) super 
116:                                .getNextPage(nextPage);
117:                    } else {
118:                        break;
119:                    }
120:                }
121:                return nextPage;
122:            }
123:
124:            /* (non-Javadoc)
125:             * @see org.eclipse.jface.wizard.IWizard#addPages()
126:             */
127:            public void addPages() {
128:                classFileLocationPage = new ClassFileLocationPage();
129:                this .addPage(classFileLocationPage);
130:                wsdlFileSelectionPage = new WSDLFileSelectionPage();
131:                this .addPage(wsdlFileSelectionPage);
132:                libPage = new LibraryAddingPage();
133:                this .addPage(libPage);
134:                serviceXMLFileSelectionPage = new ServiceXMLFileSelectionPage();
135:                this .addPage(serviceXMLFileSelectionPage);
136:                serviceXMLGenerationPage = new ServiceXMLGenerationPage();
137:                this .addPage(serviceXMLGenerationPage);
138:                serviceArchiveOutputLocationPage = new ServiceArchiveOutputLocationPage();
139:                this .addPage(serviceArchiveOutputLocationPage);
140:            }
141:
142:            /* (non-Javadobc)
143:             * @see org.eclipse.jface.wizard.IWizard#performFinish()
144:             */
145:            public boolean performFinish() {
146:
147:                WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
148:                    protected void execute(IProgressMonitor monitor)
149:                            throws CoreException, InvocationTargetException,
150:                            InterruptedException {
151:                        if (monitor == null)
152:                            monitor = new NullProgressMonitor();
153:
154:                        /*
155:                         * "7" is the total amount of steps, see below monitor.worked(amount)
156:                         */
157:                        monitor.beginTask(ServiceArchiver
158:                                .getResourceString("wizard.codegen.startmsg"),
159:                                8);
160:
161:                        try {
162:                            monitor.worked(1);
163:                            // create a wizard bean
164:                            WizardBean wizBean = new WizardBean();
165:                            monitor.worked(1);
166:                            wizBean.setPage1bean(classFileLocationPage
167:                                    .getBean());
168:                            monitor.worked(1);
169:                            wizBean
170:                                    .setWsdlBean(wsdlFileSelectionPage
171:                                            .getBean());
172:                            monitor.worked(1);
173:                            wizBean.setPage2bean(serviceXMLGenerationPage
174:                                    .getBean(serviceXMLFileSelectionPage
175:                                            .getBean()));
176:                            monitor.worked(1);
177:                            wizBean.setLibraryBean(libPage.getBean());
178:                            monitor.worked(1);
179:                            wizBean
180:                                    .setPage3bean(serviceArchiveOutputLocationPage
181:                                            .getBean());
182:                            monitor.worked(1);
183:                            new Controller().process(wizBean);
184:                            monitor.worked(1);
185:                        } catch (Throwable e) {
186:                            throw new InterruptedException(e.getMessage());
187:                        }
188:
189:                        monitor.done();
190:                    }
191:                };
192:
193:                /*
194:                 * Start the generation as new Workbench Operation, so the user
195:                 * can see the progress and, if needed, can stop the operation.
196:                 */
197:                try {
198:                    getContainer().run(false, true, op);
199:                    showSuccessMessage(ServiceArchiver
200:                            .getResourceString("wizard.codegen.success"));
201:                    return true;
202:                } catch (InvocationTargetException e1) {
203:                    showErrorMessage(e1.getTargetException().getMessage());
204:                    return false;
205:                } catch (InterruptedException e1) {
206:                    showErrorMessage(e1.getMessage());
207:                    return false;
208:                } catch (Exception e) {
209:                    showErrorMessage(ServiceArchiver
210:                            .getResourceString("wizard.codegen.unknown.error")
211:                            + "  " + e.getMessage());
212:                    return false;
213:                }
214:
215:            }
216:
217:            /* (non-Javadoc)
218:             * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
219:             */
220:            public void init(IWorkbench workbench,
221:                    IStructuredSelection selection) {
222:                // TODO Auto-generated method stub
223:
224:            }
225:
226:            private void showErrorMessage(String message) {
227:                MessageDialog.openError(this .getShell(), ServiceArchiver
228:                        .getResourceString("wizard.codegen.error.msg.heading"),
229:                        message);
230:            }
231:
232:            private void showSuccessMessage(String message) {
233:                MessageDialog
234:                        .openInformation(
235:                                this .getShell(),
236:                                ServiceArchiver
237:                                        .getResourceString("wizard.codegen.success.msg.heading"),
238:                                message);
239:            }
240:        }
w___ww_.__j___a___v___a2_s_.__c_om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.