Source Code Cross Referenced for TestEditorWizardPage.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » ui » util » editor » 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.util.editor 
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:        package com.bostechcorp.cbesb.ui.util.editor;
025:
026:        import java.io.InputStream;
027:        import java.util.ArrayList;
028:
029:        import org.eclipse.jface.resource.ImageDescriptor;
030:        import org.eclipse.jface.wizard.WizardPage;
031:        import org.eclipse.swt.SWT;
032:        import org.eclipse.swt.events.SelectionAdapter;
033:        import org.eclipse.swt.events.SelectionEvent;
034:        import org.eclipse.swt.layout.FillLayout;
035:        import org.eclipse.swt.layout.GridData;
036:        import org.eclipse.swt.layout.GridLayout;
037:        import org.eclipse.swt.widgets.Button;
038:        import org.eclipse.swt.widgets.Combo;
039:        import org.eclipse.swt.widgets.Composite;
040:        import org.eclipse.swt.widgets.Event;
041:        import org.eclipse.swt.widgets.FileDialog;
042:        import org.eclipse.swt.widgets.Group;
043:        import org.eclipse.swt.widgets.Text;
044:        import org.eclipse.ui.IWorkbench;
045:        import org.eclipse.ui.IWorkbenchPage;
046:        import org.eclipse.ui.IWorkbenchWindow;
047:        import org.eclipse.ui.PartInitException;
048:        import org.eclipse.ui.PlatformUI;
049:
050:        import com.bostechcorp.cbesb.common.i18n.I18N;
051:        import com.bostechcorp.cbesb.common.i18n.Messages;
052:
053:        public class TestEditorWizardPage extends WizardPage {
054:            private Text textFile;
055:
056:            private ArrayList<String> list;
057:
058:            protected TestEditorWizardPage(String pageName, String title,
059:                    ImageDescriptor titleImage, ArrayList<String> list) {
060:                super (pageName, title, titleImage);
061:                this .list = list;
062:                setDescription(title);
063:
064:            }
065:
066:            private IWorkbench workbench;
067:
068:            private Button openFileCheckbox;
069:
070:            private Button buttonNewLine;
071:
072:            private Button buttonEOF;
073:
074:            private Combo combo;
075:
076:            public void createControl(Composite parent) {
077:                setControl(parent);
078:                parent.setLayout(new FillLayout());
079:                Composite composite = (Composite) getControl();
080:                Composite main = new Composite(composite, SWT.NULL);
081:                main.setLayout(new GridLayout());
082:
083:                final Group choseDataFileGroup = new Group(main, SWT.NONE);
084:                final GridLayout gridLayout = new GridLayout();
085:                gridLayout.numColumns = 2;
086:                choseDataFileGroup.setLayout(gridLayout);
087:                choseDataFileGroup.setLayoutData(new GridData(SWT.FILL,
088:                        SWT.CENTER, true, false));
089:                choseDataFileGroup.setText(I18N
090:                        .getString(Messages.CHOOSE_DATA_FILE));
091:
092:                textFile = new Text(choseDataFileGroup, SWT.BORDER);
093:                textFile.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
094:                        false));
095:
096:                final Button buttonBrows = new Button(choseDataFileGroup,
097:                        SWT.NONE);
098:                buttonBrows.addSelectionListener(new SelectionAdapter() {
099:                    public void widgetSelected(final SelectionEvent e) {
100:
101:                        FileDialog dlg = new FileDialog(PlatformUI
102:                                .getWorkbench().getActiveWorkbenchWindow()
103:                                .getShell(), SWT.APPLICATION_MODAL);
104:                        dlg.setFilterNames(new String[] { " (*.mdl)",
105:                                "All Files (*.*)" });
106:                        dlg.setFilterPath(((TestEditorWizard) getWizard())
107:                                .getProjectLocation().toString()
108:                                + "/src/test/");
109:                        textFile.setText(dlg.open());
110:                        setPageComplete(true);
111:                        getWizard().canFinish();
112:                    }
113:                });
114:                buttonBrows.setText(I18N.getString(Messages.WIZARD_BROWSE));
115:
116:                final Group readStyleGroup = new Group(main, SWT.NONE);
117:                readStyleGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
118:                        true, false));
119:                readStyleGroup.setText(I18N.getString(Messages.READ_STYLE));
120:                final FillLayout fillLayout = new FillLayout();
121:                fillLayout.marginHeight = 5;
122:                readStyleGroup.setLayout(fillLayout);
123:
124:                buttonEOF = new Button(readStyleGroup, SWT.RADIO);
125:                buttonEOF.setText("End of file");
126:                buttonEOF.setSelection(true);
127:
128:                buttonNewLine = new Button(readStyleGroup, SWT.RADIO);
129:                buttonNewLine.setText("New Line");
130:
131:                if (list != null && list.size() > 0) {
132:                    final Group chooseRootMessageGroup = new Group(main,
133:                            SWT.READ_ONLY);
134:                    chooseRootMessageGroup.setLayoutData(new GridData(SWT.FILL,
135:                            SWT.CENTER, false, false));
136:                    chooseRootMessageGroup.setText(I18N
137:                            .getString(Messages.TEST_SELECT_ROOT));
138:                    chooseRootMessageGroup.setLayout(new GridLayout());
139:                    combo = new Combo(chooseRootMessageGroup, SWT.READ_ONLY);
140:                    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
141:                            true, false));
142:                    for (int i = 0; i < list.size(); i++) {
143:                        combo.add(list.get(i));
144:                    }
145:                    combo.select(0);
146:
147:                }
148:
149:                composite.setLayout(new FillLayout());
150:
151:            }
152:
153:            /**
154:             * Creates a new file resource as requested by the user. If everything is OK
155:             * then answer true. If not, false will cause the dialog to stay open.
156:             * 
157:             * @return whether creation was successful
158:             * @see MapTestingEditorWizard#performFinish()
159:             */
160:            public boolean finish() throws PartInitException {
161:                if (openFileCheckbox.getSelection()) {
162:                    IWorkbenchWindow dwindow = workbench
163:                            .getActiveWorkbenchWindow();
164:                    IWorkbenchPage page = dwindow.getActivePage();
165:                    if (page != null) {
166:                    }
167:                }
168:                return true;
169:            }
170:
171:            /**
172:             * The <code>MessageFormatCreationWizardPage</code> implementation of this
173:             * <code>WizardNewFileCreationPage</code> method generates sample headings
174:             * for sections and subsections in the newly-created Readme file according
175:             * to the selections of self's checkbox widgets
176:             */
177:            protected InputStream getInitialContents() {
178:                return null;
179:            }
180:
181:            /**
182:             * Creates a new file resource as requested by the user. If everything is OK
183:             * then answer true. If not, false will cause the dialog to stay open.
184:             * 
185:             * @return whether creation was successful
186:             * @see FormatTestWizard#performFinish()
187:             */
188:
189:            public boolean isPageComplete() {
190:                if (!textFile.getText().equals(""))
191:                    return true;
192:                else
193:                    return false;
194:            }
195:
196:            public void handleEvent(Event event) {
197:            }
198:
199:            public Text getTextFile() {
200:                return textFile;
201:            }
202:
203:            public void setTextFile(Text textFile) {
204:                this .textFile = textFile;
205:            }
206:
207:            public Button getButtonEOF() {
208:                return buttonEOF;
209:            }
210:
211:            public void setButtonEOF(Button buttonEOF) {
212:                this .buttonEOF = buttonEOF;
213:            }
214:
215:            public Button getButtonNewLine() {
216:                return buttonNewLine;
217:            }
218:
219:            public void setButtonNewLine(Button buttonNewLine) {
220:                this .buttonNewLine = buttonNewLine;
221:            }
222:
223:            public Combo getCombo() {
224:                return combo;
225:            }
226:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.