Class CaretPositionFix


  • public class CaretPositionFix
    extends java.lang.Object
    After class refresh (rename, comment, etc) the change of document is undetectable. So use Token index or offset in line to calculate the new caret position.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void restore()
      Restore caret position in refreshed code.
      void save()
      Save caret position by anchor to token under caret
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • save

        public void save()
        Save caret position by anchor to token under caret
      • restore

        public void restore()
        Restore caret position in refreshed code. Expected to be called in UI thread.