X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java index dcc2a39..2d68785 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java @@ -15,7 +15,10 @@ import java.net.MalformedURLException; 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; @@ -120,15 +123,20 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { // 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,