use of org.rstudio.studio.client.workbench.views.source.editors.text.events.EditorModeChangedEvent in project rstudio by rstudio.
the class TextEditingTargetIdleMonitor method beginMonitoring.
public void beginMonitoring() {
endMonitoring();
monitors_.add(display_.addEditorModeChangedHandler(new EditorModeChangedEvent.Handler() {
@Override
public void onEditorModeChanged(EditorModeChangedEvent event) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
refreshCommands();
}
});
}
}));
monitors_.add(display_.addCursorChangedHandler(new CursorChangedHandler() {
@Override
public void onCursorChanged(CursorChangedEvent event) {
mouseMovedLast_ = false;
timer_.schedule(DELAY_MS);
}
}));
monitors_.add(display_.addAttachHandler(new AttachEvent.Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
if (!event.isAttached())
onDetach();
}
}));
}
Aggregations