--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Tue Sep 14 13:37:29 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Tue Sep 14 14:24:51 2010 -0500
@@ -294,7 +294,7 @@
@Override
public String isValid(String newText) {
try {
- new URL(newText);
+ new URL(getLocationURL(newText));
} catch (MalformedURLException e) {
return Messages.AbstractBrowserPortalPageLayer_InvalidURLError;
}
@@ -303,9 +303,19 @@
});
int result = dlg.open();
if (result == Dialog.OK) {
- setUrl(dlg.getValue());
+ String value = dlg.getValue();
+ setUrl(getLocationURL(value));
actionBar.update();
}
+ }
+
+ private String getLocationURL(String value) {
+ try {
+ new URL(value);
+ } catch (MalformedURLException e) {
+ value = "http://" + value;
+ }
+ return value;
};
public boolean isEnabled() {