import java.net.URL;
import java.text.MessageFormat;
import java.util.Iterator;
+
+import net.sourceforge.phpeclipse.IPreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.overlaypages.Util;
import net.sourceforge.phpeclipse.views.PHPConsole;
import net.sourceforge.phpeclipse.views.browser.BrowserView;
import org.eclipse.core.resources.IFile;
// IPath path = file.getFullPath();
String localhostURL = file.getLocation().toString();
String lowerCaseFileName = localhostURL.toLowerCase();
- String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ // String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
+ String documentRoot = Util.getMiscProjectsPreferenceValue(
+ file.getProject(), IPreferenceConstants.PHP_DOCUMENTROOT_PREF);
+
documentRoot = documentRoot.replace('\\', '/');
documentRoot = documentRoot.toLowerCase();
+
if (lowerCaseFileName.startsWith(documentRoot)) {
localhostURL = localhostURL.substring(documentRoot.length());
} else {
- return null;
+ return null;
}
- return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
+// return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
+ return Util.getMiscProjectsPreferenceValue(file.getProject(), IPreferenceConstants.PHP_LOCALHOST_PREF) + localhostURL;
}
public static void open(final URL url, final Shell shell,
page.bringToTop(part);
}
((BrowserView) part).setUrl(url.toExternalForm());
- } catch (PartInitException e) {
- PHPeclipsePlugin.log(e);
+ } catch (Exception e) {
}
}
}