Author: mareshkau
Date: 2008-12-01 08:10:38 -0500 (Mon, 01 Dec 2008)
New Revision: 12163
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
fix for jbide-3205
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-12-01
12:23:14 UTC (rev 12162)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-12-01
13:10:38 UTC (rev 12163)
@@ -293,6 +293,7 @@
}
// if only refresh page
else {
+
MozillaEditor.this.onReloadWindow();
setRefreshPage(false);
}
@@ -429,7 +430,7 @@
controller=null;
}
if (xulRunnerEditor != null) {
- xulRunnerEditor.getBrowser().dispose();
+ xulRunnerEditor.dispose();
xulRunnerEditor = null;
}
@@ -501,9 +502,9 @@
}
nsIDOMNode root = xulRunnerEditor.getDOMDocument().getDocumentElement();
+
headNode = findHeadNode(root);
-
return area;
}
@@ -710,7 +711,8 @@
*
*/
private void onReloadWindow() {
-
+ //mareshkau, fix for jbide-3205
+ if(getController()!=null&&getController().isVisualEditorVisible()){
removeDomEventListeners();
xulRunnerEditor.removeResizerListener();
contentArea = findContentArea();
@@ -718,7 +720,7 @@
addSelectionListener();
xulRunnerEditor.addResizerListener();
controller.reinit();
-
+ }
}
/**
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2008-12-01
12:23:14 UTC (rev 12162)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2008-12-01
13:10:38 UTC (rev 12163)
@@ -71,11 +71,6 @@
private nsIWebBrowser webBrowser = null;
private long chrome_flags = nsIWebBrowserChrome.CHROME_ALL;
- /**
- * used to indicate that xulrunner was loaded
- */
- private static boolean XULRUNNER_LOADING_INDICATOR=false;
-
static {
XULRUNNER_BUNDLE = (new StringBuffer("org.mozilla.xulrunner")) //
$NON-NLS-1$
.append(".").append(Platform.getWS()) // $NON-NLS-1$
@@ -104,14 +99,13 @@
setup.setProperty(nsIWebBrowserSetup.SETUP_IS_CHROME_WRAPPER, 1);
// JBIDE-1329 Solution was contributed by Snjezana Peco
- // webBrowser.addWebBrowserListener(this,
- // nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
+// webBrowser.addWebBrowserListener(this,
+// nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
nsIServiceManager serviceManager = mozilla.getServiceManager();
nsIWebProgress webProgress = (nsIWebProgress) serviceManager
.getServiceByContractID("(a)mozilla.org/docloaderservice;1", //
$NON-NLS-1$
nsIWebProgress.NS_IWEBPROGRESS_IID);
- webProgress.addProgressListener(this, nsIWebProgress.NOTIFY_ALL);
-
+ webProgress.addProgressListener(this, nsIWebProgress.NOTIFY_STATE_WINDOW);
webBrowser.addWebBrowserListener(this,
nsITooltipListener.NS_ITOOLTIPLISTENER_IID);
}
@@ -170,6 +164,14 @@
* Decorate Widget.dispose()
*/
public void dispose() {
+ //added by mareshkau, here we remove listener.
+ //if we hasn't do it, listener will be continue work even after close browser
+ nsIServiceManager serviceManager = mozilla.getServiceManager();
+ nsIWebProgress webProgress = (nsIWebProgress) serviceManager
+ .getServiceByContractID("(a)mozilla.org/docloaderservice;1", // $NON-NLS-1$
+ nsIWebProgress.NS_IWEBPROGRESS_IID);
+ webProgress.removeProgressListener(this);
+
browser.dispose();
browser = null;
}
Show replies by date