public class BrowserUtil {
- public static ShowInContextBrowser getShowInContext(IFile previewFile, boolean forceDBGPreview, String postFix) {
+ public static ShowInContextBrowser getShowInContext(IFile previewFile,
+ boolean forceDBGPreview, String postFix) {
String extension = previewFile.getFileExtension().toLowerCase();
// boolean showHTMLFilesLocal = false;
// boolean showXMLFilesLocal = false;
// showHTMLFilesLocal =
// ProjectPrefUtil.getPreviewBooleanValue(previewFile,
// IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL);
- // showXMLFilesLocal = ProjectPrefUtil.getPreviewBooleanValue(previewFile,
+ // showXMLFilesLocal =
+ // ProjectPrefUtil.getPreviewBooleanValue(previewFile,
// IPreferenceConstants.PHP_SHOW_XML_FILES_LOCAL);
- isHTMLFileName = "html".equals(extension) || "htm".equals(extension) || "xhtml".equals(extension);
- isXMLFileName = "xml".equals(extension) || "xsd".equals(extension) || "dtd".equals(extension);
+ isHTMLFileName = "html".equals(extension)
+ || "htm".equals(extension) || "xhtml".equals(extension);
+ isXMLFileName = "xml".equals(extension) || "xsd".equals(extension)
+ || "dtd".equals(extension);
}
// if (showHTMLFilesLocal && isHTMLFileName) {
// localhostURL = previewFile.getLocation().toString();
// } else if (showXMLFilesLocal && isXMLFileName) {
// localhostURL = previewFile.getLocation().toString();
// } else
- if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(null, previewFile)) == null) {
+ if ((localhostURL = ShowExternalPreviewAction.getLocalhostURL(null,
+ previewFile)) == null) {
return new ShowInContextBrowser(previewFile, null, null);
}
localhostURL += postFix;
/**
* Returns the <code>IShowInTarget</code> for the given part, or
* <code>null</code> if it does not provide one.
- *
+ *
* @param targetPart
- * the target part
+ * the target part
* @return the <code>IShowInTarget</code> or <code>null</code>
*/
private static IShowInTarget getShowInTarget(IWorkbenchPart targetPart) {
return null;
}
- public static void showPreview(IFile previewFile, boolean forceDBGPreview, String postFix) {
+ public static void showPreview(IFile previewFile, boolean forceDBGPreview,
+ String postFix) {
if (previewFile == null) {
// should never happen
return;
// boolean isHTMLFileName = false;
// boolean isXMLFileName = false;
if (!forceDBGPreview) {
- autoPreview = ProjectPrefUtil.getPreviewBooleanValue(previewFile, IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
+ autoPreview = ProjectPrefUtil.getPreviewBooleanValue(
+ previewFile,
+ IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
// showHTMLFilesLocal =
// ProjectPrefUtil.getPreviewBooleanValue(previewFile,
// showXMLFilesLocal =
// ProjectPrefUtil.getPreviewBooleanValue(previewFile,
// IPreferenceConstants.PHP_SHOW_XML_FILES_LOCAL);
- // isHTMLFileName = "html".equals(extension) || "htm".equals(extension)
+ // isHTMLFileName = "html".equals(extension) ||
+ // "htm".equals(extension)
// || "xhtml".equals(extension);
- // isXMLFileName = "xml".equals(extension) || "xsd".equals(extension) ||
+ // isXMLFileName = "xml".equals(extension) ||
+ // "xsd".equals(extension) ||
// "dtd".equals(extension);
}
if (autoPreview) {
// } else if (showXMLFilesLocal && isXMLFileName) {
// localhostURL = previewFile.getLocation().toString();
// } else if ((localhostURL =
- // ShowExternalPreviewAction.getLocalhostURL(null, previewFile)) ==
+ // ShowExternalPreviewAction.getLocalhostURL(null, previewFile))
+ // ==
// null) {
// return;
// }
// localhostURL += postFix;
- ShowInContext context = getShowInContext(previewFile, forceDBGPreview, postFix);
+ ShowInContext context = getShowInContext(previewFile,
+ forceDBGPreview, postFix);
IWorkbenchPart sourcePart = page.getActivePart();
if (sourcePart == null && context != null) {
return;
}
// try {
- Perspective persp = ((WorkbenchPage) page).getActivePerspective();
+ Perspective persp = ((WorkbenchPage) page)
+ .getActivePerspective();
if (persp != null) {
// If this view is already visible just return.
- IViewReference ref = persp.findView(BrowserView.ID_BROWSER, null);
+ IViewReference ref = persp.findView(BrowserView.ID_BROWSER,
+ null);
IViewPart view = null;
if (ref != null) {
view = ref.getView(true);
if (target != null && target.show(context)) {
// success
}
- ((WorkbenchPage) page).performedShowIn(BrowserView.ID_BROWSER);
+ ((WorkbenchPage) page)
+ .performedShowIn(BrowserView.ID_BROWSER);
}
}
// IViewPart view = page.showView(BrowserView.ID_BROWSER);
// IShowInTarget target = getShowInTarget(view);
- // if (target != null && target.show(new ShowInContext(localhostURL,
+ // if (target != null && target.show(new
+ // ShowInContext(localhostURL,
// null))) {
// // success
// }
- // ((WorkbenchPage) page).performedShowIn(BrowserView.ID_BROWSER); //
+ // ((WorkbenchPage)
+ // page).performedShowIn(BrowserView.ID_BROWSER); //
// TODO: move back up
// } catch (PartInitException e) {
// WorkbenchPlugin.log(