If Browser View is already showing the URL, do nothing.
}
public void refresh(int type) {
- IFile fileToParse = getFile();
- if (fileToParse == null) {
+ IFile previewFile = getFile();
+ if (previewFile == null) {
// should never happen
return;
}
boolean autoPreview = ProjectPrefUtil.getPreviewBooleanValue(
- fileToParse, IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
+ previewFile, IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
boolean bringToTopPreview = ProjectPrefUtil.getPreviewBooleanValue(
- fileToParse,
+ previewFile,
IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
if (autoPreview) {
}
}
if (part != null) {
- ((BrowserView) part).refresh();
+ // ((BrowserView) part).refresh();
+ String localhostURL = getLocalhostURL(null, previewFile);
+ ((BrowserView) part).refresh(localhostURL);
}
} catch (Exception e) {
// PHPeclipsePlugin.log(e);
import net.sourceforge.phpeclipse.webbrowser.internal.WebBrowserUtil;
import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.CloseWindowListener;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.browser.StatusTextListener;
// }
// }, null);
// } catch (CoreException e) {
- // // TODO Auto-generated catch block
+ // // TO DO Auto-generated catch block
// e.printStackTrace();
// }
}
// }
// }, null);
// } catch (CoreException e) {
- // // TODO Auto-generated catch block
+ // // TO DO Auto-generated catch block
// e.printStackTrace();
// }
}
}
public void refresh(String url) {
- if (fInstance != null) {
- if (fUrl == null || !fUrl.equals(url)) {
+ if (fInstance != null && url != null) {
+ if (fUrl == null) {
setUrl(url);
} else {
- refresh();
+ Browser browser = fInstance.getBrowser();
+ if (browser != null && !browser.getUrl().equals(url)) {
+ setUrl(url);
+ }
}
}
}
.getInstance();
fShowExternalPreviewAction.setEditor(textEditor);
fShowExternalPreviewAction.update();
- if (fShowExternalPreviewAction != null) {
- fShowExternalPreviewAction
- .doRun(ShowExternalPreviewAction.PHP_TYPE);
- }
+ // if (fShowExternalPreviewAction != null) {
+ // fShowExternalPreviewAction
+ // .doRun(ShowExternalPreviewAction.PHP_TYPE);
+ // }
+ fShowExternalPreviewAction
+ .refresh(ShowExternalPreviewAction.PHP_TYPE);
}
}
}
\ No newline at end of file