Source Code Cross Referenced for ExportOptionsTab.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » wizards » exports » 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 » IDE Eclipse » Eclipse plug in development » org.eclipse.pde.internal.ui.wizards.exports 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2005, 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.pde.internal.ui.wizards.exports;
011:
012:        import org.eclipse.core.runtime.Path;
013:        import org.eclipse.jface.dialogs.IDialogSettings;
014:        import org.eclipse.pde.internal.core.TargetPlatformHelper;
015:        import org.eclipse.pde.internal.core.exports.FeatureExportOperation;
016:        import org.eclipse.pde.internal.ui.PDEUIMessages;
017:        import org.eclipse.pde.internal.ui.util.SWTUtil;
018:        import org.eclipse.swt.SWT;
019:        import org.eclipse.swt.events.ModifyEvent;
020:        import org.eclipse.swt.events.ModifyListener;
021:        import org.eclipse.swt.events.SelectionAdapter;
022:        import org.eclipse.swt.events.SelectionEvent;
023:        import org.eclipse.swt.layout.GridData;
024:        import org.eclipse.swt.layout.GridLayout;
025:        import org.eclipse.swt.widgets.Button;
026:        import org.eclipse.swt.widgets.Combo;
027:        import org.eclipse.swt.widgets.Composite;
028:        import org.eclipse.swt.widgets.Control;
029:        import org.eclipse.swt.widgets.Text;
030:
031:        public class ExportOptionsTab extends AbstractExportTab {
032:
033:            protected static final String S_JAR_FORMAT = "exportUpdate"; //$NON-NLS-1$
034:            private static final String S_EXPORT_SOURCE = "exportSource"; //$NON-NLS-1$
035:            private static final String S_SAVE_AS_ANT = "saveAsAnt"; //$NON-NLS-1$
036:            private static final String S_ANT_FILENAME = "antFileName"; //$NON-NLS-1$
037:            private static final String S_QUALIFIER = "qualifier"; //$NON-NLS-1$
038:            private static final String S_QUALIFIER_NAME = "qualifierName"; //$NON-NLS-1$
039:
040:            private Button fIncludeSource;
041:            protected Button fJarButton;
042:            private Button fSaveAsAntButton;
043:            private Combo fAntCombo;
044:            private Button fBrowseAnt;
045:
046:            private Button fQualifierButton;
047:            private Text fQualifierText;
048:
049:            public ExportOptionsTab(BaseExportWizardPage page) {
050:                super (page);
051:            }
052:
053:            protected Control createControl(Composite parent) {
054:                Composite container = new Composite(parent, SWT.NONE);
055:                container.setLayout(new GridLayout());
056:                container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
057:
058:                addSourceOption(container);
059:                addJAROption(container);
060:                addCrossPlatformOption(container);
061:                addQualifierOption(container);
062:                addAntSection(container);
063:
064:                return container;
065:            }
066:
067:            protected void addSourceOption(Composite comp) {
068:                fIncludeSource = new Button(comp, SWT.CHECK);
069:                fIncludeSource
070:                        .setText(PDEUIMessages.ExportWizard_includeSource);
071:            }
072:
073:            protected void addJAROption(Composite comp) {
074:                fJarButton = new Button(comp, SWT.CHECK);
075:                fJarButton.setText(getJarButtonText());
076:                fJarButton.addSelectionListener(new SelectionAdapter() {
077:                    public void widgetSelected(SelectionEvent e) {
078:                    }
079:                });
080:            }
081:
082:            protected String getJarButtonText() {
083:                return PDEUIMessages.BaseExportWizardPage_packageJARs;
084:            }
085:
086:            protected void addCrossPlatformOption(Composite comp) {
087:            }
088:
089:            protected void addAntSection(Composite container) {
090:                Composite comp = new Composite(container, SWT.NONE);
091:                GridLayout layout = new GridLayout(3, false);
092:                layout.marginHeight = layout.marginWidth = 0;
093:                comp.setLayout(layout);
094:                comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
095:
096:                fSaveAsAntButton = new Button(comp, SWT.CHECK);
097:                fSaveAsAntButton.setText(PDEUIMessages.ExportWizard_antCheck);
098:                GridData gd = new GridData();
099:                gd.horizontalSpan = 1;
100:                fSaveAsAntButton.setLayoutData(gd);
101:
102:                fAntCombo = new Combo(comp, SWT.NONE);
103:                fAntCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
104:
105:                fBrowseAnt = new Button(comp, SWT.PUSH);
106:                fBrowseAnt.setText(PDEUIMessages.ExportWizard_browse);
107:                fBrowseAnt.setLayoutData(new GridData());
108:                SWTUtil.setButtonDimensionHint(fBrowseAnt);
109:            }
110:
111:            protected void addQualifierOption(Composite container) {
112:                Composite comp = new Composite(container, SWT.NONE);
113:                GridLayout layout = new GridLayout(2, false);
114:                layout.marginHeight = layout.marginWidth = 0;
115:                comp.setLayout(layout);
116:                comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
117:
118:                fQualifierButton = new Button(comp, SWT.CHECK);
119:                fQualifierButton
120:                        .setText(PDEUIMessages.AdvancedPluginExportPage_qualifier);
121:
122:                fQualifierText = new Text(comp, SWT.SINGLE | SWT.BORDER);
123:                fQualifierText.setLayoutData(new GridData(
124:                        GridData.FILL_HORIZONTAL));
125:                fQualifierText.addModifyListener(new ModifyListener() {
126:                    public void modifyText(ModifyEvent e) {
127:                        fPage.pageChanged();
128:                    }
129:                });
130:            }
131:
132:            protected void initialize(IDialogSettings settings) {
133:                fIncludeSource.setSelection(settings
134:                        .getBoolean(S_EXPORT_SOURCE));
135:                fJarButton.setSelection(getInitialJarButtonSelection(settings));
136:                fSaveAsAntButton.setSelection(settings
137:                        .getBoolean(S_SAVE_AS_ANT));
138:                initializeCombo(settings, S_ANT_FILENAME, fAntCombo);
139:                fAntCombo.setEnabled(fSaveAsAntButton.getSelection());
140:                fBrowseAnt.setEnabled(fSaveAsAntButton.getSelection());
141:                fQualifierButton.setSelection(settings.getBoolean(S_QUALIFIER));
142:                fQualifierText.setText(getInitialQualifierText(settings));
143:                fQualifierText.setEnabled(fQualifierButton.getSelection());
144:                hookListeners();
145:            }
146:
147:            protected void saveSettings(IDialogSettings settings) {
148:                settings.put(S_JAR_FORMAT, fJarButton.getSelection());
149:                settings.put(S_EXPORT_SOURCE, fIncludeSource.getSelection());
150:                settings.put(S_SAVE_AS_ANT, fSaveAsAntButton.getSelection());
151:                settings.put(S_QUALIFIER, fQualifierButton.getSelection());
152:                settings.put(S_QUALIFIER_NAME, fQualifierText.getText());
153:                saveCombo(settings, S_ANT_FILENAME, fAntCombo);
154:            }
155:
156:            private String getInitialQualifierText(IDialogSettings settings) {
157:                String qualifier = settings.get(S_QUALIFIER_NAME);
158:                if (qualifier == null || qualifier.equals("")) //$NON-NLS-1$
159:                    return FeatureExportOperation.getDate();
160:                return qualifier;
161:            }
162:
163:            protected boolean getInitialJarButtonSelection(
164:                    IDialogSettings settings) {
165:                String selected = settings.get(S_JAR_FORMAT);
166:                return selected == null ? TargetPlatformHelper
167:                        .getTargetVersion() >= 3.1 : "true".equals(selected); //$NON-NLS-1$
168:            }
169:
170:            protected void hookListeners() {
171:                fJarButton.addSelectionListener(new SelectionAdapter() {
172:                    public void widgetSelected(SelectionEvent e) {
173:                        ((BaseExportWizardPage) fPage)
174:                                .adjustAdvancedTabsVisibility();
175:                    }
176:                });
177:                fSaveAsAntButton.addSelectionListener(new SelectionAdapter() {
178:                    public void widgetSelected(SelectionEvent e) {
179:                        fAntCombo.setEnabled(fSaveAsAntButton.getSelection());
180:                        fBrowseAnt.setEnabled(fSaveAsAntButton.getSelection());
181:                        fPage.pageChanged();
182:                    }
183:                });
184:
185:                fBrowseAnt.addSelectionListener(new SelectionAdapter() {
186:                    public void widgetSelected(SelectionEvent e) {
187:                        chooseFile(fAntCombo, "*.xml"); //$NON-NLS-1$
188:                    }
189:                });
190:
191:                fAntCombo.addSelectionListener(new SelectionAdapter() {
192:                    public void widgetSelected(SelectionEvent e) {
193:                        fPage.pageChanged();
194:                    }
195:                });
196:
197:                fAntCombo.addModifyListener(new ModifyListener() {
198:                    public void modifyText(ModifyEvent e) {
199:                        fPage.pageChanged();
200:                    }
201:                });
202:                fQualifierButton.addSelectionListener(new SelectionAdapter() {
203:                    public void widgetSelected(SelectionEvent e) {
204:                        fQualifierText.setEnabled(fQualifierButton
205:                                .getSelection());
206:                        fPage.pageChanged();
207:                    }
208:                });
209:            }
210:
211:            protected String validate() {
212:                if (fSaveAsAntButton.getSelection()
213:                        && fAntCombo.getText().trim().length() == 0)
214:                    return PDEUIMessages.ExportWizard_status_noantfile;
215:                return null;
216:            }
217:
218:            protected String validateAntCombo() {
219:                String path = new Path(fAntCombo.getText()).lastSegment();
220:                if ("build.xml".equals(path)) //$NON-NLS-1$
221:                    return PDEUIMessages.ExportOptionsTab_antReservedMessage;
222:                return null;
223:            }
224:
225:            protected boolean doExportSource() {
226:                return fIncludeSource.getSelection();
227:            }
228:
229:            protected boolean useJARFormat() {
230:                return fJarButton.getSelection();
231:            }
232:
233:            protected boolean doGenerateAntFile() {
234:                return fSaveAsAntButton.getSelection();
235:            }
236:
237:            protected String getAntBuildFileName() {
238:                return fSaveAsAntButton.getSelection() ? fAntCombo.getText()
239:                        : null;
240:            }
241:
242:            protected String getQualifier() {
243:                if (fQualifierText.isEnabled()) {
244:                    String qualifier = fQualifierText.getText().trim();
245:                    if (qualifier.length() > 0)
246:                        return qualifier;
247:                }
248:                return null;
249:            }
250:
251:        }
w___w_w_.__j__ava__2___s___.__co__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.