Class EditCorrectorHooks

java.lang.Object
org.luwrain.script.controls.EditCorrectorHooks
All Implemented Interfaces:
MultilineEdit.Model, MultilineEditCorrector, Lines

public class EditCorrectorHooks extends Object implements MultilineEditCorrector
A translator of text correcting operations to hooks actions. This class can wrap any instance of MultilineEditCorrector with calls of the hooks prior and after of the corresponding action of the underlying corrector.

The call of the hook prior to the operation may cancel the operation, if it returns false. If it returns any other value , including null and undefined, the processing will be continued. The hooks called after the operation may return any value, it is never taken into account in any way.

All hooks handlers must expect the single argument with members, which set depends on the purpose of the particular operation. In the meantime, the argument always has the lines and hotPoint members, since they are actual for any operation.

Here is the list of the hooks created by this class where base is a string value provided with the constructor:

  • base.delete.char.pre
  • base.delete.char.post
  • base.delete.region.pre
  • base.delete.region.post
  • base.insert.region.pre
  • base.insert.region.post
  • base.insert.chars.pre
  • base.insert.chars.post
  • base.merge.lines.pre
  • base.merge.lines.post
  • base.split.lines.pre
  • base.split.lines.post