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

SetComposingTextCommand

public final class SetComposingTextCommand implements EditCommand


Replace the currently composing text with the given text, and set the new cursor position. Any composing text set previously will be removed automatically.

See setComposingText.

Summary

Public constructors

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

Public methods

void

Apply the command on the editing buffer.

boolean
equals(Object other)
final @NonNull AnnotatedString

The composing text.

final int

The cursor position after setting composing text.

final @NonNull String
int
@NonNull String

Public constructors

SetComposingTextCommand

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

The composing text.

int newCursorPosition

The cursor position after setting composing text.

SetComposingTextCommand

public SetComposingTextCommand(@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 composing text.

getNewCursorPosition

public final int getNewCursorPosition()

The cursor position after setting composing text.

getText

public final @NonNull String getText()

hashCode

public int hashCode()

toString

public @NonNull String toString()