Search in sources :

Example 1 with SynctexViewPdfEvent

use of org.rstudio.studio.client.common.synctex.events.SynctexViewPdfEvent in project rstudio by rstudio.

the class Synctex method doForwardSearch.

private void doForwardSearch(String rootDocument, JavaScriptObject sourceLocationObject) {
    SourceLocation sourceLocation = sourceLocationObject.cast();
    final ProgressIndicator indicator = getSyncProgress();
    server_.synctexForwardSearch(rootDocument, sourceLocation, new ServerRequestCallback<PdfLocation>() {

        @Override
        public void onResponseReceived(PdfLocation location) {
            indicator.onCompleted();
            if (location != null)
                eventBus_.fireEvent(new SynctexViewPdfEvent(location));
        }

        @Override
        public void onError(ServerError error) {
            indicator.onError(error.getUserMessage());
        }
    });
}
Also used : SourceLocation(org.rstudio.studio.client.common.synctex.model.SourceLocation) PdfLocation(org.rstudio.studio.client.common.synctex.model.PdfLocation) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) ServerError(org.rstudio.studio.client.server.ServerError) SynctexViewPdfEvent(org.rstudio.studio.client.common.synctex.events.SynctexViewPdfEvent)

Aggregations

ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)1 SynctexViewPdfEvent (org.rstudio.studio.client.common.synctex.events.SynctexViewPdfEvent)1 PdfLocation (org.rstudio.studio.client.common.synctex.model.PdfLocation)1 SourceLocation (org.rstudio.studio.client.common.synctex.model.SourceLocation)1 ServerError (org.rstudio.studio.client.server.ServerError)1