Source Code Cross Referenced for DeployeDialog.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » ui » componentflow » componentFlowEditor » diagram » actions » 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 » ESB » cbesb 1.2 » com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.actions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ChainBuilder ESB
003:         *          Visual Enterprise Integration
004:         * 
005:         * Copyright (C) 2006 Bostech Corporation
006:         * 
007:         * This program is free software; you can redistribute it and/or modify it 
008:         * under the terms of the GNU General Public License as published by the 
009:         * Free Software Foundation; either version 2 of the License, or (at your option) 
010:         * any later version.
011:         *
012:         * This program is distributed in the hope that it will be useful, 
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
014:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
015:         * for more details.
016:         * 
017:         * You should have received a copy of the GNU General Public License along with 
018:         * this program; if not, write to the Free Software Foundation, Inc., 
019:         * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020:         *
021:         *
022:         * $Id$
023:         */
024:
025:        package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.actions;
026:
027:        import java.io.File;
028:        import java.io.FilenameFilter;
029:        import java.util.ArrayList;
030:
031:        import org.eclipse.core.resources.ResourcesPlugin;
032:        import org.eclipse.jface.dialogs.Dialog;
033:        import org.eclipse.jface.dialogs.IDialogConstants;
034:        import org.eclipse.swt.SWT;
035:        import org.eclipse.swt.events.ModifyEvent;
036:        import org.eclipse.swt.events.ModifyListener;
037:        import org.eclipse.swt.events.SelectionAdapter;
038:        import org.eclipse.swt.events.SelectionEvent;
039:        import org.eclipse.swt.graphics.Point;
040:        import org.eclipse.swt.layout.GridData;
041:        import org.eclipse.swt.layout.GridLayout;
042:        import org.eclipse.swt.widgets.Button;
043:        import org.eclipse.swt.widgets.Composite;
044:        import org.eclipse.swt.widgets.Control;
045:        import org.eclipse.swt.widgets.DirectoryDialog;
046:        import org.eclipse.swt.widgets.Label;
047:        import org.eclipse.swt.widgets.Shell;
048:        import org.eclipse.swt.widgets.Text;
049:        import org.eclipse.ui.PlatformUI;
050:        import org.eclipse.ui.part.FileEditorInput;
051:
052:        import com.bostechcorp.cbesb.common.i18n.I18N;
053:        import com.bostechcorp.cbesb.common.i18n.Messages;
054:        import com.bostechcorp.cbesb.common.util.FileUtil;
055:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.HTTP;
056:        import com.bostechcorp.cbesb.ui.util.ProjectUtil;
057:
058:        public class DeployeDialog extends Dialog {
059:
060:            private Text exportDirectoryText;
061:            private Button browseButton;
062:            private String exportPath = "";
063:            private boolean exportFlag = false;
064:            private Button buttonExport;
065:            private ArrayList<HTTP> list;
066:            private String projectName = "";
067:
068:            /**
069:             * Create the dialog
070:             * @param parentShell
071:             */
072:            public DeployeDialog(Shell parentShell, ArrayList<HTTP> list,
073:                    String projectName) {
074:                super (parentShell);
075:                this .list = list;
076:                this .projectName = projectName;
077:            }
078:
079:            /**
080:             * Create contents of the dialog
081:             * @param parent
082:             */
083:            @Override
084:            protected Control createDialogArea(Composite parent) {
085:                Composite container = (Composite) super 
086:                        .createDialogArea(parent);
087:                final GridLayout gridLayout = new GridLayout();
088:                gridLayout.marginTop = 10;
089:                gridLayout.verticalSpacing = 10;
090:                gridLayout.numColumns = 3;
091:                container.setLayout(gridLayout);
092:
093:                final Label theServiceAssemblyLabel = new Label(container,
094:                        SWT.NONE);
095:                final GridData gridData = new GridData(SWT.LEFT, SWT.CENTER,
096:                        false, false, 2, 1);
097:                gridData.heightHint = 34;
098:                theServiceAssemblyLabel.setLayoutData(gridData);
099:                theServiceAssemblyLabel.setText(I18N
100:                        .getString(Messages.DEPLOY_WSDL_EXPORT));
101:                new Label(container, SWT.NONE);
102:
103:                buttonExport = new Button(container, SWT.CHECK);
104:                buttonExport.addSelectionListener(new SelectionAdapter() {
105:                    public void widgetSelected(final SelectionEvent e) {
106:                        if (buttonExport.getSelection()) {
107:                            exportDirectoryText.setEnabled(true);
108:                            browseButton.setEnabled(true);
109:                            dialogChange();
110:
111:                        } else {
112:                            exportDirectoryText.setEnabled(false);
113:                            browseButton.setEnabled(false);
114:                            dialogChange();
115:                        }
116:                    }
117:                });
118:
119:                buttonExport.setLayoutData(new GridData());
120:                buttonExport.setText(I18N
121:                        .getString(Messages.DEPLOY_WSDL_EXPORT_YES));
122:                new Label(container, SWT.NONE);
123:                new Label(container, SWT.NONE);
124:
125:                final Label exportToDirectoryLabel = new Label(container,
126:                        SWT.NONE);
127:                exportToDirectoryLabel.setText(I18N
128:                        .getString(Messages.DEPLOY_WSDL_EXPORT_TO_DIRECTORY));
129:
130:                exportDirectoryText = new Text(container, SWT.READ_ONLY
131:                        | SWT.BORDER);
132:                exportDirectoryText.setLayoutData(new GridData(SWT.FILL,
133:                        SWT.CENTER, true, false));
134:                exportDirectoryText.addModifyListener(new ModifyListener() {
135:
136:                    public void modifyText(ModifyEvent e) {
137:
138:                        dialogChange();
139:                    }
140:
141:                });
142:
143:                browseButton = new Button(container, SWT.NONE);
144:                browseButton.addSelectionListener(new SelectionAdapter() {
145:                    public void widgetSelected(final SelectionEvent e) {
146:                        String projectLocation = ((FileEditorInput) PlatformUI
147:                                .getWorkbench().getActiveWorkbenchWindow()
148:                                .getActivePage().getActiveEditor()
149:                                .getEditorInput()).getFile().getProject()
150:                                .getLocation().toOSString();
151:                        DirectoryDialog dialog = new DirectoryDialog(
152:                                browseButton.getShell());
153:                        dialog.setFilterPath(projectLocation + "/src/wsdl");
154:                        dialog.setMessage(I18N
155:                                .getString(Messages.DEPLOY_WSDL_EXPORT_SELECT));
156:                        exportDirectoryText.setText(dialog.open());
157:                    }
158:                });
159:                browseButton.setText(I18N.getString(Messages.WIZARD_BROWSE));
160:                browseButton.setEnabled(false);
161:
162:                //
163:                return container;
164:            }
165:
166:            protected void dialogChange() {
167:
168:                if (buttonExport.getSelection()) {
169:                    if (exportDirectoryText.getText().equals("")) {
170:                        getOKButton().setEnabled(false);
171:
172:                    } else {
173:                        getOKButton().setEnabled(true);
174:                    }
175:                } else {
176:                    getOKButton().setEnabled(true);
177:                }
178:            }
179:
180:            @Override
181:            protected void okPressed() {
182:
183:                if (buttonExport.getSelection()) {
184:                    for (int i = 0; i < list.size(); i++) {
185:                        HTTP httpModel = list.get(i);
186:                        String servicesUnitName = projectName + "_"
187:                                + httpModel.getName();
188:                        //				String wsdlPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()
189:                        //						+File.separator+projectName+"/src/SUs/"+servicesUnitName+"/wsdlPublic/"+servicesUnitName+".wsdl";
190:                        String wsdlPath = ResourcesPlugin.getWorkspace()
191:                                .getRoot().getLocation().toOSString()
192:                                + File.separator
193:                                + projectName
194:                                + "/src/SUs/"
195:                                + servicesUnitName + "/wsdlPublic/";
196:                        File wsdlDir = new File(wsdlPath);
197:                        File[] wsdlList = wsdlDir.listFiles(new WsdlFilter());
198:                        for (int j = 0; j < wsdlList.length; j++) {
199:                            FileUtil.copyFile(wsdlList[j], exportDirectoryText
200:                                    .getText());
201:                        }
202:                    }
203:                    ProjectUtil.refreshProject(projectName);
204:                }
205:                super .okPressed();
206:            }
207:
208:            @Override
209:            protected void cancelPressed() {
210:
211:                super .cancelPressed();
212:            }
213:
214:            /**
215:             * Create contents of the button bar
216:             * @param parent
217:             */
218:            @Override
219:            protected void createButtonsForButtonBar(Composite parent) {
220:                createButton(parent, IDialogConstants.OK_ID,
221:                        IDialogConstants.OK_LABEL, true);
222:                createButton(parent, IDialogConstants.CANCEL_ID,
223:                        IDialogConstants.CANCEL_LABEL, false);
224:            }
225:
226:            /**
227:             * Return the initial size of the dialog
228:             */
229:            @Override
230:            protected Point getInitialSize() {
231:                return new Point(492, 261);
232:            }
233:
234:            public boolean isExportFlag() {
235:                return exportFlag;
236:            }
237:
238:            public String getExportPath() {
239:                return exportPath;
240:            }
241:
242:            protected void configureShell(Shell newShell) {
243:                super .configureShell(newShell);
244:                newShell.setText(I18N.getString(Messages.DEPLOY_DIALOG));
245:            }
246:
247:            public static class WsdlFilter implements  FilenameFilter {
248:
249:                public boolean accept(File dir, String name) {
250:                    return name.endsWith(".wsdl");
251:                }
252:
253:            }
254:
255:        }
w__w__w___.j___a_v__a_2___s.___c___om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.