Lines 13-21
Link Here
|
13 |
* Configuration Manager, for Multi-configs support. |
13 |
* Configuration Manager, for Multi-configs support. |
14 |
* Diego Sandin (Motorola) - Use Eclipse Message Bundles [Bug 255874] |
14 |
* Diego Sandin (Motorola) - Use Eclipse Message Bundles [Bug 255874] |
15 |
* Fernando Rocha(Motorola)- Add validation to JAR URL. |
15 |
* Fernando Rocha(Motorola)- Add validation to JAR URL. |
|
|
16 |
* Fernando Rocha(Motorola)- Problem marker for the description file. |
16 |
*/ |
17 |
*/ |
17 |
package org.eclipse.mtj.internal.ui.editors.jad.form.pages; |
18 |
package org.eclipse.mtj.internal.ui.editors.jad.form.pages; |
18 |
|
19 |
|
|
|
20 |
import org.eclipse.core.resources.IFile; |
19 |
import org.eclipse.core.resources.IResource; |
21 |
import org.eclipse.core.resources.IResource; |
20 |
import org.eclipse.core.resources.IWorkspace; |
22 |
import org.eclipse.core.resources.IWorkspace; |
21 |
import org.eclipse.core.runtime.CoreException; |
23 |
import org.eclipse.core.runtime.CoreException; |
Lines 157-171
Link Here
|
157 |
public void doSave(IProgressMonitor monitor) { |
159 |
public void doSave(IProgressMonitor monitor) { |
158 |
super.doSave(monitor); |
160 |
super.doSave(monitor); |
159 |
|
161 |
|
|
|
162 |
IFile applicationDescriptorFile = midletProject.getApplicationDescriptorFile(); |
163 |
try { |
164 |
Utils.removeAllErrorMarkers(applicationDescriptorFile); |
165 |
} catch (CoreException e) { |
166 |
e.printStackTrace(); |
167 |
} |
168 |
|
160 |
String currentJarUrl = getPreferenceStore().getString( |
169 |
String currentJarUrl = getPreferenceStore().getString( |
161 |
IJADConstants.JAD_MIDLET_JAR_URL); |
170 |
IJADConstants.JAD_MIDLET_JAR_URL); |
|
|
171 |
String currentMidletName = getPreferenceStore().getString(IJADConstants.JAD_MIDLET_NAME); |
172 |
String currentMidletVendor = getPreferenceStore().getString(IJADConstants.JAD_MIDLET_VENDOR); |
173 |
String currentMidletVersion = getPreferenceStore().getString(IJADConstants.JAD_MIDLET_VERSION); |
174 |
|
175 |
if(currentMidletName.equals("")) { |
176 |
try { |
177 |
Utils.createErrorMarker(applicationDescriptorFile, "MIDLet name empty."); |
178 |
} catch (CoreException e) { |
179 |
e.printStackTrace(); |
180 |
} |
181 |
} |
182 |
if(currentMidletVendor.equals("")) { |
183 |
try { |
184 |
Utils.createErrorMarker(applicationDescriptorFile, "MIDLet vendor empty."); |
185 |
} catch (CoreException e) { |
186 |
e.printStackTrace(); |
187 |
} |
188 |
} |
189 |
if(currentMidletVersion.equals("")) { |
190 |
try { |
191 |
Utils.createErrorMarker(applicationDescriptorFile, "MIDLet version empty."); |
192 |
} catch (CoreException e) { |
193 |
e.printStackTrace(); |
194 |
} |
195 |
} |
162 |
|
196 |
|
163 |
IWorkspace workspace = MTJCore.getWorkspace(); |
197 |
if (!Utils.isValidFileName(currentJarUrl)) { |
164 |
IStatus result = workspace.validateName(currentJarUrl, IResource.FILE); |
|
|
165 |
if (!result.isOK()) { |
166 |
getPreferenceStore().putValue(IJADConstants.JAD_MIDLET_JAR_URL, |
198 |
getPreferenceStore().putValue(IJADConstants.JAD_MIDLET_JAR_URL, |
167 |
loadedJarUrl); |
199 |
loadedJarUrl); |
168 |
getErrorMessageManager().removeAllMessages(); |
200 |
getErrorMessageManager().removeAllMessages(); |
|
|
201 |
|
169 |
} else if (!currentJarUrl.substring(currentJarUrl.length() - 4) |
202 |
} else if (!currentJarUrl.substring(currentJarUrl.length() - 4) |
170 |
.equalsIgnoreCase(".jar")) { //$NON-NLS-1$ |
203 |
.equalsIgnoreCase(".jar")) { //$NON-NLS-1$ |
171 |
getPreferenceStore().putValue(IJADConstants.JAD_MIDLET_JAR_URL, |
204 |
getPreferenceStore().putValue(IJADConstants.JAD_MIDLET_JAR_URL, |