From 0b922084db357c46b21f96e398f64bc774096f17 Mon Sep 17 00:00:00 2001 From: toshihiro Date: Mon, 20 Aug 2007 02:33:07 +0000 Subject: [PATCH 1/1] Fixed: 1777185 - Remote Debug option 'Open with ...' should work --- .../src/net/sourceforge/phpeclipse/ui/WebUI.java | 15 ++++++++++++++- .../phpeclipse/ui/editor/BrowserUtil.java | 10 ++++++++++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/WebUI.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/WebUI.java index 4293601..ef6360d 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/WebUI.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/WebUI.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial implementation * - * $Id: WebUI.java,v 1.8 2007-07-12 03:58:05 dizmo Exp $ + * $Id: WebUI.java,v 1.9 2007-08-20 02:33:07 toshihiro Exp $ */ package net.sourceforge.phpeclipse.ui; @@ -41,6 +41,9 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; * The web development tools UI plugin. */ public class WebUI extends AbstractUIPlugin implements IPreferenceConstants { + + private static final String PLUGIN_ID = "net.sourceforge.phpeclipse.ui"; + private static final String CUSTOM_TEMPLATES_KEY = "net.sourceforge.phpeclipse.ui.templates"; //$NON-NLS-1$ // Constants --------------------------------------------------------------- @@ -181,10 +184,20 @@ public class WebUI extends AbstractUIPlugin implements IPreferenceConstants { reg.put(ICON_OVERLAY_ERROR, getImageDescriptor(ICON_OVERLAY_ERROR)); reg.put(ICON_OVERLAY_WARNING, getImageDescriptor(ICON_OVERLAY_WARNING)); } + // private IWorkbenchPage internalGetActivePage() { // IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow(); // if (window != null) // return window.getActivePage(); // return null; // } + + public static void log(IStatus status) { + getDefault().getLog().log(status); + } + + public static void log(Throwable e) { + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, e + .getLocalizedMessage(), e)); + } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java index f5781be..d6ce54c 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java @@ -11,6 +11,7 @@ import org.eclipse.ui.IViewPart; import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; import org.eclipse.ui.internal.Perspective; import org.eclipse.ui.internal.WorkbenchPage; import org.eclipse.ui.part.IShowInTarget; @@ -134,6 +135,15 @@ public class BrowserUtil { if (ref != null) { view = ref.getView(true); } + if (view == null && forceDBGPreview) { + try { + view = persp.showView(BrowserView.ID_BROWSER, null); + persp.bringToTop(persp.findView( + BrowserView.ID_BROWSER, null)); + } catch (PartInitException e) { + WebUI.log(e); + } + } if (view != null) { IShowInTarget target = getShowInTarget(view); if (target != null && target.show(context)) { -- 1.7.1