Bug 3099 - Preview is not working on Linux when building on top of Helios
authorEugene Ostroukhov <eugeneo@symbian.org>
Thu, 01 Jul 2010 16:35:38 -0700
changeset 414 dbe3521f62de
parent 413 817cf8083ab8
child 415 8198c73b9e1f
Bug 3099 - Preview is not working on Linux when building on top of Helios
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	Thu Jul 01 15:41:21 2010 -0700
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/AbstractPreviewPage.java	Thu Jul 01 16:35:38 2010 -0700
@@ -43,7 +43,6 @@
     private boolean toggleState = true;
     private final PreviewView previewView;
     private boolean needsRefresh = false;
-    private Composite pane;
 
     public AbstractPreviewPage(IProject project, PreviewView previewView) {
         this.project = project;
@@ -62,19 +61,9 @@
 
     @Override
     public void createControl(Composite parent) {
-        pane = new Composite(parent, SWT.EMBEDDED);
-        GridLayout layout = new GridLayout();
-        layout.marginWidth = 0;
-        layout.marginHeight = 0;
-        pane.setLayout(layout);
-        addBrowser();
-    }
-
-    private void addBrowser() {
-        browser = createBrowser(pane);
+        browser = createBrowser(parent);
         browser.setLayoutData(new GridData(GridData.FILL_BOTH));
         browser.setUrl(getURI().toASCIIString());
-        pane.layout();
     }
 
     protected abstract Browser createBrowser(Composite parent);
@@ -85,7 +74,7 @@
 
     @Override
     public Control getControl() {
-        return pane;
+        return browser;
     }
 
     @Override
@@ -132,7 +121,7 @@
         try {
             if (!isDisposed()) {
                 final Control focusControl = browser.getDisplay().getFocusControl();
-                browser.setUrl(browser.getUrl());
+                browser.setUrl(getURI().toASCIIString());
                 refreshAction.setImageDescriptor(PreviewerPlugin.getImageDescriptor(Images.GREEN_SYNC));
                 if (!manual && focusControl != null) {
                     asyncExec(new Runnable() {
@@ -219,12 +208,6 @@
     public synchronized void projectRenamed(IPath newPath) {
         if (!isDisposed()) {
             project = ResourcesPlugin.getWorkspace().getRoot().getProject(newPath.lastSegment());
-            asyncExec(new Runnable() {
-                public void run() {
-                    browser.dispose();
-                    addBrowser();
-                }
-            });
         }
     }
 }