Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState Class Reference

Public Member Functions

 TextEditState ( @NonNull String text, int selectionStart, int selectionEnd, int composingStart, int composingEnd) throws IndexOutOfBoundsException
 
boolean hasSelection ()
 
boolean hasComposing ()
 

Static Public Member Functions

static TextEditState fromJson (@NonNull JSONObject textEditState) throws JSONException
 

Public Attributes

final String text
 
final int selectionStart
 
final int selectionEnd
 
final int composingStart
 
final int composingEnd
 

Detailed Description

State of an on-going text editing session.

Definition at line 762 of file TextInputChannel.java.

Constructor & Destructor Documentation

◆ TextEditState()

io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.TextEditState ( @NonNull String  text,
int  selectionStart,
int  selectionEnd,
int  composingStart,
int  composingEnd 
) throws IndexOutOfBoundsException
inline

Definition at line 779 of file TextInputChannel.java.

785 {
786
787 if ((selectionStart != -1 || selectionEnd != -1)
788 && (selectionStart < 0 || selectionEnd < 0)) {
789 throw new IndexOutOfBoundsException(
790 "invalid selection: ("
791 + String.valueOf(selectionStart)
792 + ", "
793 + String.valueOf(selectionEnd)
794 + ")");
795 }
796
797 if ((composingStart != -1 || composingEnd != -1)
798 && (composingStart < 0 || composingStart > composingEnd)) {
799 throw new IndexOutOfBoundsException(
800 "invalid composing range: ("
801 + String.valueOf(composingStart)
802 + ", "
803 + String.valueOf(composingEnd)
804 + ")");
805 }
806
807 if (composingEnd > text.length()) {
808 throw new IndexOutOfBoundsException(
809 "invalid composing start: " + String.valueOf(composingStart));
810 }
811
812 if (selectionStart > text.length()) {
813 throw new IndexOutOfBoundsException(
814 "invalid selection start: " + String.valueOf(selectionStart));
815 }
816
817 if (selectionEnd > text.length()) {
818 throw new IndexOutOfBoundsException(
819 "invalid selection end: " + String.valueOf(selectionEnd));
820 }
821
822 this.text = text;
823 this.selectionStart = selectionStart;
824 this.selectionEnd = selectionEnd;
825 this.composingStart = composingStart;
826 this.composingEnd = composingEnd;
827 }

Member Function Documentation

◆ fromJson()

static TextEditState io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.fromJson ( @NonNull JSONObject  textEditState) throws JSONException
inlinestatic

Definition at line 764 of file TextInputChannel.java.

764 {
765 return new TextEditState(
766 textEditState.getString("text"),
767 textEditState.getInt("selectionBase"),
768 textEditState.getInt("selectionExtent"),
769 textEditState.getInt("composingBase"),
770 textEditState.getInt("composingExtent"));
771 }
TextEditState( @NonNull String text, int selectionStart, int selectionEnd, int composingStart, int composingEnd)

◆ hasComposing()

boolean io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.hasComposing ( )
inline

Definition at line 835 of file TextInputChannel.java.

835 {
837 }

◆ hasSelection()

boolean io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.hasSelection ( )
inline

Definition at line 829 of file TextInputChannel.java.

829 {
830 // When selectionStart == -1, it's guaranteed that selectionEnd will also
831 // be -1.
832 return selectionStart >= 0;
833 }

Member Data Documentation

◆ composingEnd

final int io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.composingEnd

Definition at line 777 of file TextInputChannel.java.

◆ composingStart

final int io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.composingStart

Definition at line 776 of file TextInputChannel.java.

◆ selectionEnd

final int io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.selectionEnd

Definition at line 775 of file TextInputChannel.java.

◆ selectionStart

final int io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.selectionStart

Definition at line 774 of file TextInputChannel.java.

◆ text

final String io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState.text

Definition at line 773 of file TextInputChannel.java.


The documentation for this class was generated from the following file: