Class TextChange


  • public class TextChange
    extends TextSpan
    Describes a single contiguous text edit as a range and replacement string. This is used to describe the changes that should be made to a source file.
    Author:
    Chris Jennings
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String newText
      The text to replace the text span with.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextChange​(int start, int length, java.lang.String newText)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(CodeEditorBase editor)
      Applies the change to an open editor.
      java.lang.String apply​(java.lang.String text)
      Applies the change to a string containing the original text.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • newText

        public java.lang.String newText
        The text to replace the text span with.
    • Constructor Detail

      • TextChange

        public TextChange​(int start,
                          int length,
                          java.lang.String newText)
    • Method Detail

      • apply

        public void apply​(CodeEditorBase editor)
        Applies the change to an open editor.
      • apply

        public java.lang.String apply​(java.lang.String text)
        Applies the change to a string containing the original text.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class TextSpan