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 (+3 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_warning_launchConfigContainsProgramArgs=Program arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR
31
FatJarPackageWizardPage_warning_launchConfigContainsVMArgs=VM arguments will not be part of the runnable JAR. Arguments can be passed on the command line when launching the JAR
29
FatJarPackageWizardPage_error_noMainMethod=Could not find main method from given launch configuration.
32
FatJarPackageWizardPage_error_noMainMethod=Could not find main method from given launch configuration.
30
FatJarPackageWizardPage_launchConfigGroupTitle=Select the launch configuration:
33
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.
34
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 (-3 / +55 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
			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
(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerMessages.java (+3 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_warning_launchConfigContainsProgramArgs;
39
	public static String FatJarPackageWizardPage_warning_launchConfigContainsVMArgs;
37
	public static String FatJarPackageWizardPage_error_noMainMethod;
40
	public static String FatJarPackageWizardPage_error_noMainMethod;
38
	public static String FatJarPackageWizardPage_launchConfigGroupTitle;
41
	public static String FatJarPackageWizardPage_launchConfigGroupTitle;
39
	public static String FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning;
42
	public static String FatJarPackageWizardPage_LaunchConfigurationWithoutMainType_warning;

Return to bug 211045