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 |
String result = getLaunchConfigurationAttibute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$ |
128 |
return result; |
129 |
} |
130 |
|
131 |
public String getLaunchConfigurationVMArguments() { |
132 |
String result = getLaunchConfigurationAttibute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); //$NON-NLS-1$ |
133 |
return result; |
134 |
} |
135 |
|
136 |
private String getLaunchConfigurationAttibute(String attributeName, String defaultValue) { |
137 |
String result = defaultValue; |
138 |
try { |
139 |
result = fLaunchConfiguration.getAttribute(attributeName, defaultValue); |
140 |
} catch (CoreException e) { |
141 |
JavaPlugin.log(e); |
142 |
} |
143 |
return result; |
144 |
} |
145 |
|
120 |
} |
146 |
} |
121 |
|
147 |
|
122 |
private static final String PAGE_NAME= "FatJarPackageWizardPage"; //$NON-NLS-1$ |
148 |
private static final String PAGE_NAME= "FatJarPackageWizardPage"; //$NON-NLS-1$ |
Lines 198-203
Link Here
|
198 |
} |
224 |
} |
199 |
|
225 |
|
200 |
public boolean isPageComplete() { |
226 |
public boolean isPageComplete() { |
|
|
227 |
clearMessages(); |
201 |
boolean complete= validateDestinationGroup(); |
228 |
boolean complete= validateDestinationGroup(); |
202 |
complete= validateLaunchConfigurationGroup() && complete; |
229 |
complete= validateLaunchConfigurationGroup() && complete; |
203 |
if (complete) |
230 |
if (complete) |
Lines 206-214
Link Here
|
206 |
} |
233 |
} |
207 |
|
234 |
|
208 |
private boolean validateLaunchConfigurationGroup() { |
235 |
private boolean validateLaunchConfigurationGroup() { |
209 |
return fLaunchConfigurationCombo.getSelectionIndex() != -1; |
236 |
int lcIdx = fLaunchConfigurationCombo.getSelectionIndex(); |
|
|
237 |
boolean ok = lcIdx != -1; |
238 |
if (ok) { |
239 |
LaunchConfigurationElement element= (LaunchConfigurationElement) fLauchConfigurationModel.get(lcIdx); |
240 |
String prgArgs = element.getLaunchConfigurationProgramArguments(); |
241 |
if ((prgArgs != null) && (prgArgs.trim().length()>0)) { |
242 |
setOneInfoMessage(FatJarPackagerMessages.FatJarPackageWizardPage_info_launchConfigContainsProgramArgs); |
243 |
} |
244 |
String vmArgs = element.getLaunchConfigurationVMArguments(); |
245 |
if ((vmArgs != null) && (vmArgs.trim().length()>0)) { |
246 |
setOneInfoMessage(FatJarPackagerMessages.FatJarPackageWizardPage_info_launchConfigContainsVMArgs); |
247 |
} |
248 |
} |
249 |
else { |
250 |
setOneErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_noLaunchConfigSelected); |
251 |
} |
252 |
return ok; |
210 |
} |
253 |
} |
211 |
|
254 |
|
|
|
255 |
private void clearMessages() { |
256 |
if (getErrorMessage() != null) |
257 |
setErrorMessage(null); |
258 |
if (getMessage() != null) |
259 |
setMessage(null); |
260 |
} |
261 |
|
262 |
private void setOneInfoMessage(String newMessage) { |
263 |
if (getMessage() == null) { |
264 |
setMessage(newMessage, IMessageProvider.INFORMATION); |
265 |
} |
266 |
} |
267 |
|
268 |
private void setOneErrorMessage(String newMessage) { |
269 |
if (getErrorMessage() == null) { |
270 |
setErrorMessage(newMessage); |
271 |
} |
272 |
} |
212 |
private LaunchConfigurationElement[] getLaunchConfigurations() { |
273 |
private LaunchConfigurationElement[] getLaunchConfigurations() { |
213 |
ArrayList result= new ArrayList(); |
274 |
ArrayList result= new ArrayList(); |
214 |
|
275 |
|