MaxLengthDocumentFilter

open class MaxLengthDocumentFilter(maxLength: Int) : DocumentFilter(source)

A document filter that ensures the document always contains at most maxLength characters.

Parameters

maxLength

the maximum length of the text in the document, must be at least 1

Inheritors

Constructors

Link copied to clipboard
constructor(maxLength: Int)

Functions

Link copied to clipboard
open override fun insertString(fb: DocumentFilter.FilterBypass, offset: Int, text: String?, attr: AttributeSet?)

Inserts text into the document with attributes attr, using fb to bypass recursively invoking the filter.

Link copied to clipboard
open override fun replace(fb: DocumentFilter.FilterBypass, offset: Int, length: Int, text: String?, attrs: AttributeSet?)

Replaces length characters starting at offset with text, applying attributes attrs, using fb to bypass recursively invoking the filter.