{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

CommitTextCommand

public final class CommitTextCommand implements EditCommand


Commit final text to the text box and set the new cursor position.

See commitText.

Summary

Public constructors

CommitTextCommand(
    @NonNull AnnotatedString annotatedString,
    int newCursorPosition
)
CommitTextCommand(@NonNull String text, int newCursorPosition)

Public methods

void

Apply the command on the editing buffer.

boolean
equals(Object other)
final @NonNull AnnotatedString

The text to commit.

final int

The cursor position after inserted text.

final @NonNull String
int
@NonNull String

Public constructors

CommitTextCommand

public CommitTextCommand(
    @NonNull AnnotatedString annotatedString,
    int newCursorPosition
)
Parameters
@NonNull AnnotatedString annotatedString

The text to commit.

int newCursorPosition

The cursor position after inserted text.

CommitTextCommand

public CommitTextCommand(@NonNull String text, int newCursorPosition)

Public methods

applyTo

public void applyTo(@NonNull EditingBuffer buffer)

Apply the command on the editing buffer.

equals

public boolean equals(Object other)

getAnnotatedString

public final @NonNull AnnotatedString getAnnotatedString()

The text to commit.

getNewCursorPosition

public final int getNewCursorPosition()

The cursor position after inserted text.

getText

public final @NonNull String getText()

hashCode

public int hashCode()

toString

public @NonNull String toString()