Search in sources :

Example 1 with RecordNavigationPositionEvent

use of org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionEvent 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)

Example 2 with RecordNavigationPositionEvent

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

the class AceEditor method fireRecordNavigationPosition.

private void fireRecordNavigationPosition(Position pos) {
    SourcePosition srcPos = SourcePosition.create(pos.getRow(), pos.getColumn());
    fireEvent(new RecordNavigationPositionEvent(srcPos));
}
Also used : RecordNavigationPositionEvent(org.rstudio.studio.client.workbench.views.source.events.RecordNavigationPositionEvent) SourcePosition(org.rstudio.studio.client.workbench.views.source.model.SourcePosition)

Aggregations

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