Minor bug with browser refresh after the workbench was stopped was cleared
authorEugene Ostroukhov <eugeneo@symbian.org>
Mon, 15 Feb 2010 14:25:05 -0800
changeset 146 65c80c40a76a
parent 145 19985c154f5c
child 147 dbf55fd11104
Minor bug with browser refresh after the workbench was stopped was cleared
org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/AbstractPreviewPage.java
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/AbstractPreviewPage.java	Mon Feb 15 13:46:26 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/AbstractPreviewPage.java	Mon Feb 15 14:25:05 2010 -0800
@@ -114,18 +114,19 @@
 
 	protected synchronized void refresh(boolean manual) {
 		try {
-			final Control focusControl = browser.getDisplay().getFocusControl();
-			browser.refresh();
-			refreshAction.setImageDescriptor(PreviewerPlugin
-					.getImageDescriptor(Images.GREEN_SYNC));
-			if (!manual && focusControl != null) {
-				asyncExec(new Runnable() {
-					public void run() {
-						focusControl.setFocus();
-					}
-				});
+			if (!browser.isDisposed()) {
+				final Control focusControl = browser.getDisplay().getFocusControl();
+				browser.refresh();
+				refreshAction.setImageDescriptor(PreviewerPlugin.getImageDescriptor(Images.GREEN_SYNC));
+				if (!manual && focusControl != null) {
+					asyncExec(new Runnable() {
+						public void run() {
+							focusControl.setFocus();
+						}
+					});
+				}
+				refreshAction.setToolTipText("Refresh the preview browser");
 			}
-			refreshAction.setToolTipText("Refresh the preview browser");
 			needsRefresh = false;
 		} finally {
 			refreshScheduled = false;