mixed with <zebkit.EventProducer>
extends <>

Multi-lines text model implementation

Constructor: ([s])

  • [s] <String>

    the specified text the model has to be filled

private <Array> calcLineByOffset ([start], [startOffset], o)

Detect line by offset starting from the given line and offset.

  • [start] <Integer>

    start line

  • [startOffset] <Integer>

    start offset of the start line

  • o <Integer>

    offset to detect line

Returns: <Array>

an array that consists of two elements: detected line index and its offset

protected <Integer> calcLineOffset (line)

Calculate an offset in the text the first character of the specified line.

  • line <Integer>

    a line index

Returns: <Integer>

an offset

public void insertLines (startLine, [lines])

Insert number of lines starting from the given starting line

  • startLine <Integer>

    a starting line to insert lines

  • [lines] <String> (*..n)

    string lines to inserted

public void removeLines (start, [size])

Remove number of text lines starting form the specified line

  • start <Integer>

    a starting line to remove text lines

  • [size] <Integer>

    a number of lines to be removed. If the argument is not passed number equals 1

private <> lines

Array of lines

private <Integer> textLength

Text length

Inherited events: