Author: snjeza
Date: 2009-10-15 10:59:43 -0400 (Thu, 15 Oct 2009)
New Revision: 18111
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5023 Project Examples import a local copy of the
settings file does not work.
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2009-10-15
14:04:22 UTC (rev 18110)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2009-10-15
14:59:43 UTC (rev 18111)
@@ -1,5 +1,6 @@
package org.jboss.tools.project.examples.preferences;
+import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Set;
@@ -128,8 +129,6 @@
browse.addSelectionListener(new SelectionListener(){
public void widgetSelected(SelectionEvent e) {
-
-
FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
dialog.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$;
@@ -137,7 +136,12 @@
if (result == null || result.trim().length() == 0) {
return;
}
- urlText.setText("file:/" + result); //$NON-NLS-1$
+ try {
+ String urlString = new File(result).toURL().toString();
+ urlText.setText(urlString);
+ } catch (MalformedURLException e1) {
+ urlText.setText("file:///" + result); //$NON-NLS-1$
+ }
}
public void widgetDefaultSelected(SelectionEvent e) {