Class EditCorrectors.WordWrapCorrector

java.lang.Object
org.luwrain.controls.edit.EditUtils.EmptyCorrector
org.luwrain.controls.edit.EditCorrectors.WordWrapCorrector
All Implemented Interfaces:
MultilineEdit.Model, MultilineEditCorrector, Lines
Enclosing class:
EditCorrectors

public static class EditCorrectors.WordWrapCorrector extends EditUtils.EmptyCorrector
  • Field Details

    • lineLen

      protected final int lineLen
  • Constructor Details

  • Method Details

    • putChars

      public MultilineEdit.ModificationResult putChars(int pos, int lineIndex, String str)
      Description copied from interface: MultilineEdit.Model
      Puts one or several characters at some position. The position expects to be valid in the content of the model, except of the case when there are no lines at all, lineIndex equals to zero and pos equals to zero. In this case the method must insert one empty line prior to making any required changes.

      After performing the operation, the method must prepare the MultilineEdit.ModificationResult object. If the chars arguments has the length greater than one, the string argument of the result must be set to the value of chars argument.

      If chars argument has the length equals to one, this single character must be returned as the character argument of the result. If the method is requested to insert a single spacing character, the string argument of the result must contain the last word prior to the inserting position. If there is no any word prior to the inserting position, the result may have the string argument empty.

      Specified by:
      putChars in interface MultilineEdit.Model
      Overrides:
      putChars in class EditUtils.EmptyCorrector
      Parameters:
      pos - The position on the line to put characters at
      lineIndex - The index of the line to put characters on
      str - The characters to put
      Returns:
      The MultilineEdit.ModificationResult object with the flag if the operation was performed and other corresponding information