Search in sources :

Example 1 with RecordNavigationPositionHandler

use of org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionHandler in project rstudio by rstudio.

the class TextEditingTarget method addRecordNavigationPositionHandler.

public static void addRecordNavigationPositionHandler(ArrayList<HandlerRegistration> releaseOnDismiss, final DocDisplay docDisplay, final EventBus events, final EditingTarget target) {
    releaseOnDismiss.add(docDisplay.addRecordNavigationPositionHandler(new RecordNavigationPositionHandler() {

        @Override
        public void onRecordNavigationPosition(RecordNavigationPositionEvent event) {
            SourcePosition pos = SourcePosition.create(target.getContext(), event.getPosition().getRow(), event.getPosition().getColumn(), docDisplay.getScrollTop());
            events.fireEvent(new SourceNavigationEvent(SourceNavigation.create(target.getId(), target.getPath(), pos)));
        }
    }));
}
Also used : RecordNavigationPositionEvent(org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionEvent) SourceNavigationEvent(org.rstudio.studio.client.workbench.views.source.events.SourceNavigationEvent) RecordNavigationPositionHandler(org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionHandler)

Aggregations

RecordNavigationPositionEvent (org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionEvent)1 RecordNavigationPositionHandler (org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionHandler)1 SourceNavigationEvent (org.rstudio.studio.client.workbench.views.source.events.SourceNavigationEvent)1