Lines 8-13
Link Here
|
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
10 |
* Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar |
10 |
* Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar |
|
|
11 |
* Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 211045 [jar application] program arguments are ignored |
11 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
12 |
package org.eclipse.jdt.internal.ui.jarpackagerfat; |
13 |
package org.eclipse.jdt.internal.ui.jarpackagerfat; |
13 |
|
14 |
|
Lines 39-44
Link Here
|
39 |
|
40 |
|
40 |
import org.eclipse.jface.dialogs.Dialog; |
41 |
import org.eclipse.jface.dialogs.Dialog; |
41 |
import org.eclipse.jface.dialogs.IDialogSettings; |
42 |
import org.eclipse.jface.dialogs.IDialogSettings; |
|
|
43 |
import org.eclipse.jface.dialogs.IMessageProvider; |
42 |
import org.eclipse.jface.operation.IRunnableContext; |
44 |
import org.eclipse.jface.operation.IRunnableContext; |
43 |
import org.eclipse.jface.viewers.IStructuredSelection; |
45 |
import org.eclipse.jface.viewers.IStructuredSelection; |
44 |
|
46 |
|
Lines 82-87
Link Here
|
82 |
|
84 |
|
83 |
public abstract String getLaunchConfigurationName(); |
85 |
public abstract String getLaunchConfigurationName(); |
84 |
|
86 |
|
|
|
87 |
public abstract String getLaunchConfigurationProgramArguments(); |
88 |
|
89 |
public abstract String getLaunchConfigurationVMArguments(); |
90 |
|
85 |
public void dispose() { |
91 |
public void dispose() { |
86 |
//do nothing |
92 |
//do nothing |
87 |
} |
93 |
} |
Lines 117-122
Link Here
|
117 |
return result.toString(); |
123 |
return result.toString(); |
118 |
} |
124 |
} |
119 |
|
125 |
|
|
|
126 |
public String getLaunchConfigurationProgramArguments() { |
127 |
return getLaunchConfigurationAttibute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$ |
128 |
} |
129 |
|
130 |
public String getLaunchConfigurationVMArguments() { |
131 |
return getLaunchConfigurationAttibute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); //$NON-NLS-1$ |
132 |
} |
133 |
|
134 |
private String getLaunchConfigurationAttibute(String attributeName, String defaultValue) { |
135 |
try { |
136 |
return fLaunchConfiguration.getAttribute(attributeName, defaultValue); |
137 |
} catch (CoreException e) { |
138 |
JavaPlugin.log(e); |
139 |
return defaultValue; |
140 |
} |
141 |
} |
142 |
|
120 |
} |
143 |
} |
121 |
|
144 |
|
122 |
private static final String PAGE_NAME= "FatJarPackageWizardPage"; //$NON-NLS-1$ |
145 |
private static final String PAGE_NAME= "FatJarPackageWizardPage"; //$NON-NLS-1$ |
Lines 198-214
Link Here
|
198 |
} |
221 |
} |
199 |
|
222 |
|
200 |
public boolean isPageComplete() { |
223 |
public boolean isPageComplete() { |
|
|
224 |
clearMessages(); |
201 |
boolean complete= validateDestinationGroup(); |
225 |
boolean complete= validateDestinationGroup(); |
202 |
complete= validateLaunchConfigurationGroup() && complete; |
226 |
complete= validateLaunchConfigurationGroup() && complete; |
203 |
if (complete) |
|
|
204 |
setErrorMessage(null); |
205 |
return complete; |
227 |
return complete; |
206 |
} |
228 |
} |
207 |
|
229 |
|
208 |
private boolean validateLaunchConfigurationGroup() { |
230 |
private boolean validateLaunchConfigurationGroup() { |
209 |
return fLaunchConfigurationCombo.getSelectionIndex() != -1; |
231 |
int lcIdx= fLaunchConfigurationCombo.getSelectionIndex(); |
|
|
232 |
if (lcIdx == -1) |
233 |
return false; |
234 |
LaunchConfigurationElement element= (LaunchConfigurationElement) fLauchConfigurationModel.get(lcIdx); |
235 |
String args= element.getLaunchConfigurationProgramArguments(); |
236 |
if ((args != null) && (args.trim().length() > 0)) |
237 |
setWarningMessage(FatJarPackagerMessages.FatJarPackageWizardPage_warning_launchConfigContainsProgramArgs); |
238 |
args= element.getLaunchConfigurationVMArguments(); |
239 |
if ((args != null) && (args.trim().length() > 0)) |
240 |
setWarningMessage(FatJarPackagerMessages.FatJarPackageWizardPage_warning_launchConfigContainsVMArgs); |
241 |
return true; |
210 |
} |
242 |
} |
211 |
|
243 |
|
|
|
244 |
/** |
245 |
* clear all previously set messages and error-messages |
246 |
*/ |
247 |
private void clearMessages() { |
248 |
if (getErrorMessage() != null) |
249 |
setErrorMessage(null); |
250 |
if (getMessage() != null) |
251 |
setMessage(null); |
252 |
} |
253 |
|
254 |
/** |
255 |
* set message to newMessage with severity WARNING. |
256 |
* overwrite existing message only if it is beyond severity WARNING |
257 |
* @param newMessage the warning to be set |
258 |
*/ |
259 |
private void setWarningMessage(String newMessage) { |
260 |
if ((getMessage() == null) || (getMessageType() < IMessageProvider.WARNING)) |
261 |
setMessage(newMessage, IMessageProvider.WARNING); |
262 |
} |
263 |
|
212 |
private LaunchConfigurationElement[] getLaunchConfigurations() { |
264 |
private LaunchConfigurationElement[] getLaunchConfigurations() { |
213 |
ArrayList result= new ArrayList(); |
265 |
ArrayList result= new ArrayList(); |
214 |
|
266 |
|