// only handle PDF compile events when we're the preferred viewer
if (!prefs_.getPdfPreviewValue().equals(UIPrefs.PDF_PREVIEW_RSTUDIO))
return;
// only handle successful compiles
final CompilePdfResult result = event.getResult();
if (!result.getSucceeded())
return;
// when the PDF is finished rendering, optionally navigate to the desired
// location, or set and restore the current location
final PdfLocation pdfLocation = result.getPdfLocation();
if (pdfLocation != null)
{
executeOnPdfLoad_ = new Operation()
{
@Override
public void execute()
{
PdfJsWindow.navigateTo(pdfJsWindow_, pdfLocation);
}
};
}
lastSuccessfulPdfPath_ = result.getPdfPath();
openPdfUrl(result.getViewPdfUrl(), result.isSynctexAvailable(),
pdfLocation == null);
}