X-Git-Url: http://secure.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 29a88f5..f12aa38 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java @@ -22,7 +22,6 @@ import net.sourceforge.phpeclipse.views.PHPConsole; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; import org.eclipse.help.IHelp; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; @@ -39,7 +38,6 @@ import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PartInitException; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.update.internal.ui.UpdatePerspective; -import org.eclipse.update.internal.ui.UpdateUIPlugin; import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser; //import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil; // import org.eclipse.help.ui.browser.LaunchURL; @@ -88,24 +86,6 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { // single file: IFile file = (IFile) resource; String localhostURL; -// IPath path = file.getFullPath(); -// -// String localhostURL = file.getLocation().toString(); -// String lowerCaseFileName = localhostURL.toLowerCase(); -// // fileName = "http://localhost"+fileName.replaceAll("c:", ""); -// String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF); -// documentRoot = documentRoot.replace('\\', '/'); -// documentRoot = documentRoot.toLowerCase(); -// -// if (lowerCaseFileName.startsWith(documentRoot)) { -// localhostURL = localhostURL.substring(documentRoot.length()); -// } else { -// MessageDialog.openInformation(shell, "Wrong DocumentRoot", "Adjust DocumentRoot: " + documentRoot); -// return; -// } -// -// localhostURL = store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL.replaceAll(documentRoot, ""); - if ((localhostURL=getLocalhostURL(store, (IFile) resource)) == null) { MessageDialog.openInformation(shell, "Couldn't create localhost URL", "Please configure your localhost and documentRoot"); return; @@ -150,11 +130,10 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { store = PHPeclipsePlugin.getDefault().getPreferenceStore(); } - IPath path = file.getFullPath(); + // IPath path = file.getFullPath(); String localhostURL = file.getLocation().toString(); String lowerCaseFileName = localhostURL.toLowerCase(); - // fileName = "http://localhost"+fileName.replaceAll("c:", ""); String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF); documentRoot = documentRoot.replace('\\', '/'); documentRoot = documentRoot.toLowerCase(); @@ -165,7 +144,7 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { return null; } - return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL.replaceAll(documentRoot, ""); + return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL; } @@ -180,7 +159,7 @@ public class PHPEclipseShowAction implements IObjectActionDelegate { page.bringToTop(part); ((IEmbeddedWebBrowser) part).openTo(url.toExternalForm()); } catch (PartInitException e) { - UpdateUIPlugin.logException(e); + PHPeclipsePlugin.log(e); } } else { IHelp help = WorkbenchHelp.getHelpSupport();