Zebra API Doc

zebra.ui.PassTextField Class

Password text field.

Methods

calcPreferredSize

(
  • t
)
Object

Inherited from zebra.ui.ViewPan:

Override the parent method to calculate preferred size basing on a target view.

Parameters:


Return: Object

return a target view preferred size if it is defined. The returned structure is the following: { width: {Integer}, height:{Integer} }

clearSelection

()

Inherited from zebra.ui.TextField:

Clear a text selection.

drawCursor

(
  • g
)
protected

Inherited from zebra.ui.TextField:

Draw the text field cursor

Parameters:

  • g 2DContext

    a 2D contextnn

getColor

() String

Inherited from zebra.ui.Label:

Get the label text color


Return: String

a zebra label color

getEndSelection

() Array

Inherited from zebra.ui.TextField:

Get an ending position (row and column) of a selected text


Return: Array

a position of a selected text. First element of is a row and second column of selected text. null if there is no any selected text

getFont

() zebra.ui.Font

Inherited from zebra.ui.Label:

Get the label text font


Return: zebra.ui.Font

a zebra label font

getSelectedText

() String

Inherited from zebra.ui.TextField:

Get a selected text


Return: String

a selected text

getStartSelection

() Array

Inherited from zebra.ui.TextField:

Get a starting position (row and column) of a selected text


Return: Array

a position of a selected text. First element of is a row and second column of selected text. null if there is no any selected text

getTextRowColAt

(
  • x
  • y
)
Array

Inherited from zebra.ui.TextField:

Compute a text column and row by the given location.

Parameters:

  • x Integer

    a x coordinate

  • y Integer

    a y coordinate


Return: Array

a text row and column as an Array object. Fist element of the array is row and the second one is column.

getValue

() String

Inherited from zebra.ui.Label:

Get the label text


Return: String

a zebra label text

hasSelection

() Boolean

Inherited from zebra.ui.TextField:

Test if the text field has a selected text


Return: Boolean

true if the text field has a selected text

isFiltered

(
  • e
)
Boolean protected

Inherited from zebra.ui.TextField:

Test if the given key pressed event has to be processed

Parameters:


Return: Boolean

true if the given key pressed event doesn't have be processed

remove

(
  • pos
  • size
)

Inherited from zebra.ui.TextField:

Remove the specified part of edited text

Parameters:

  • pos Integer

    a start position of a removed text

  • size Integer

    a size of removed text

removeSelected

()

Inherited from zebra.ui.TextField:

Remove selected text

select

(
  • startOffset
  • endOffset
)

Inherited from zebra.ui.TextField:

Select the specified part of the edited text

Parameters:

  • startOffset Integer

    a start position of a selected text

  • endOffset Integer

    an end position of a selected text

setBlinking

(
  • [period]
)

Inherited from zebra.ui.TextField:

Set the specified blinking period of the text field cursor

Parameters:

  • [period] Integer optional

    a text field cursor blinking period (in milliseconds), use -1 to disable cursor blinking. If the argument is not passed the default (500ms) blinking period will be applied.

setColor

(
  • c
)
chainable

Inherited from zebra.ui.Label:

Set the label text color

Parameters:

  • c String

    a text color

setCursorView

(
  • v
)

Inherited from zebra.ui.TextField:

Set the cursor view. The view defines rendering of the text field cursor.

Parameters:

setEditable

(
  • b
)

Inherited from zebra.ui.TextField:

Control the text field editable state

Parameters:

  • b Boolean

    true to make the text field editable

setFont

(
  • f
)
chainable

Inherited from zebra.ui.Label:

Set the label text font

Parameters:

setHint

(
  • hint
  • font
  • color
)

Inherited from zebra.ui.TextField:

Set the specified hint text to be drawn with the given font and color. The hint is not-editable text that is shown in empty text field to help a user to understand which input the text field expects.

Parameters:

  • hint String

    a hint text

  • font String | zebra.ui.Font

    a font

  • color String

    a hint color

setModel

(
  • m
)

Inherited from zebra.ui.TextField:

Set the text field text model

Parameters:

setPosition

(
  • p
)

Inherited from zebra.ui.TextField:

Set the specified cursor position controller

Parameters:

setPSByRowsCols

(
  • r
  • c
)

Inherited from zebra.ui.TextField:

Adjust the size of the text field component to be enough to place the given number of rows and columns.

Parameters:

  • r Integer

    a row of the text the height of the text field has to be adjusted

  • c Integer

    a column of the text the width of the text field has to be adjusted

setSelectionColor

(
  • c
)

Inherited from zebra.ui.TextField:

Set selection color

Parameters:

  • c String

    a selection color

setValue

(
  • s
)

Inherited from zebra.ui.Label

Set the text content of the text field component

Parameters:

  • s String

    a text the text field component has to be filled

setView

(
  • v
)
chainable

Inherited from zebra.ui.ViewPan:

Set the target view to be wrapped with the UI component

Parameters:

  • v zebra.ui.View | Function

    a view or a rendering view "paint(g,x,y,w,h,c)" function

write

(
  • pos
  • s
)

Inherited from zebra.ui.TextField:

Insert the specified text into the edited text at the given position

Parameters:

  • pos Integer

    a start position of a removed text

  • s String

    a text to be inserted

Attributes

blinkigPeriod

Number readonly

Inherited from zebra.ui.TextField:

Specify the text field cursor blinking period in milliseconds. -1 means no blinkable cursor

Default: -1

curView

zebra.ui.View readonly

Inherited from zebra.ui.TextField:

Cursor view

isEditable

Boolean readonly

Inherited from zebra.ui.TextField:

Indicate if the text field is editable

Default: true

selectionColor

String readonly

Inherited from zebra.ui.TextField:

Selection color

view

zebra.ui.View readonly

Inherited from zebra.ui.ViewPan:

Reference to a view that the component visualize

Default: null