View | Details | Raw Unified | Return to bug 211045 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerMessages.properties (+4 lines)
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
13
13
JarPackageWizard_windowTitle= Runnable JAR File Export
14
JarPackageWizard_windowTitle= Runnable JAR File Export
Lines 26-31 Link Here
26
FatJarPackageWizardPage_error_missingClassFile=Fat Jar Export: Could not find classpath entry for ''{0}''
27
FatJarPackageWizardPage_error_missingClassFile=Fat Jar Export: Could not find classpath entry for ''{0}''
27
FatJarPackageWizard_IPIssueDialog_message=This operation does repack libraries. Make sure you have the required legal rights to do so.
28
FatJarPackageWizard_IPIssueDialog_message=This operation does repack libraries. Make sure you have the required legal rights to do so.
28
FatJarPackageWizard_IPIssueDialog_title=Runnable JAR File Export
29
FatJarPackageWizard_IPIssueDialog_title=Runnable JAR File Export
30
FatJarPackageWizardPage_info_launchConfigContainsProgramArgs=Note: Program arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR
31
FatJarPackageWizardPage_info_launchConfigContainsVMArgs=Note: VM arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR
32
FatJarPackageWizardPage_error_noLaunchConfigSelected=no launch configuration is selected
29
FatJarPackageWizardPage_error_noMainMethod=Could not find main method from given launch configuration.
33
FatJarPackageWizardPage_error_noMainMethod=Could not find main method from given launch configuration.
30
FatJarPackageWizardPage_launchConfigGroupTitle=Select the launch configuration:
34
FatJarPackageWizardPage_launchConfigGroupTitle=Select the launch configuration:
31
FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning=The selected launch configuration has no type with a main method attached. The resulting jar will not be runnable.
35
FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning=The selected launch configuration has no type with a main method attached. The resulting jar will not be runnable.
(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java (-1 / +62 lines)
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
(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerMessages.java (+4 lines)
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 34-39 Link Here
34
35
35
	public static String FatJarPackageWizard_IPIssueDialog_title;
36
	public static String FatJarPackageWizard_IPIssueDialog_title;
36
37
38
	public static String FatJarPackageWizardPage_info_launchConfigContainsProgramArgs;
39
	public static String FatJarPackageWizardPage_info_launchConfigContainsVMArgs;
40
	public static String FatJarPackageWizardPage_error_noLaunchConfigSelected;
37
	public static String FatJarPackageWizardPage_error_noMainMethod;
41
	public static String FatJarPackageWizardPage_error_noMainMethod;
38
	public static String FatJarPackageWizardPage_launchConfigGroupTitle;
42
	public static String FatJarPackageWizardPage_launchConfigGroupTitle;
39
	public static String FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning;
43
	public static String FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning;

Return to bug 211045