Class zebkit.data.TextModel
mixed with <zebkit.data.DataModel>
<zebkit.data>

Abstract text model class




public <String> getLine (line)
public <Integer> getLines ( )
public <Integer> getTextLength ( )
public <String> getValue ( )
public void remove (offset, size)
public void setValue (text)
public void write (s, offset)

public <String> getLine (line)

Get the given string line stored in the model


Parameters:
  • line <Integer>

    a line number


Returns: <String>

a string line

public <Integer> getLines ( )

Get number of lines stored in the text model


Returns: <Integer>

a number of lines

public <Integer> getTextLength ( )

Get number of characters stored in the model


Returns: <Integer>

a number of characters

public <String> getValue ( )

Get wrapped by the text model original text string


Returns: <String>

an original text

public void remove (offset, size)

Remove substring from the text model.


Parameters:
  • offset <Integer>

    an offset starting from that a substring will be removed

  • size <Integer>

    a size of a substring to be removed

public void setValue (text)

Fill the text model with the given text


Parameters:
  • text <String>

    a new text to be set for the text model

public void write (s, offset)

Write the given string in the text model starting from the specified offset


Parameters:
  • s <String>

    a string to be written into the text model

  • offset <Integer>

    an offset starting from that the passed string has to be written into the text model


textUpdated

Fired when the text model has been updated: a string has been inserted or removed

   text.on(function(e) {
       ...
   });

Parameters: