Author: DartPeng
Date: 2008-10-13 22:47:53 -0400 (Mon, 13 Oct 2008)
New Revision: 10818
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
Log:
JBIDE-2885
Validate the file path
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-14
02:40:34 UTC (rev 10817)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-14
02:47:53 UTC (rev 10818)
@@ -3,6 +3,7 @@
*/
package org.jboss.tools.smooks.xml;
+import java.io.File;
import java.util.Collections;
import org.eclipse.core.resources.IFile;
@@ -182,12 +183,9 @@
// dialog.setInitialSelections(selectedResources);
if (files.length > 0) {
IFile file = files[0];
- String s = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(
- file.getFullPath()).toString();
+ String s = file.getLocation().toOSString();
relationT.setText(s);
- return;
}
- relationT.setText("");
}
protected Composite createFileSelectionComposite(Composite parent) {
@@ -313,9 +311,7 @@
String path = dialog.open();
if (path != null) {
relationText.setText(path);
- } else {
- relationText.setText("");
- }
+ }
}
protected void changeWizardPageStatus() {
@@ -323,6 +319,12 @@
String error = null;
if (text == null || "".equals(text))
error = "Please Select a file";
+
+ File tempFile = new File(text);
+ if(!tempFile.exists()){
+ error = "Can't find the file , please select another one.";
+ }
+
// if (!reasourceLoaded) {
// error = "Resource must be loaded";
// }
Show replies by date