Class zebkit.data.Text
mixed with <zebkit.EventProducer>
extends <zebkit.data.TextModel>
<zebkit.data>

Multi-lines text model implementation

Constructor:
zebkit.data.Text ([s])

Parameters:
  • [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.


Parameters:
  • [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.


Parameters:
  • line <Integer>

    a line index


Returns: <Integer>

an offset

public void insertLines (startLine, [lines])

Insert number of lines starting from the given starting line


Parameters:
  • 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


Parameters:
  • 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 <zebkit.data.Text.Line> lines

Array of lines

private <Integer> textLength

Text length



Inherited events: