Record Class PasswordTextBox.State
java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.control.field.PasswordTextBox.State
- Record Components:
length- the length in code pointscaret- the caret indexanchor- the end of the selection that stays put while the caret moves; equal tocaretwhen nothing is selectedmaxLength- the maximum length, in code pointsrevealed- whether the text showed
- Enclosing interface:
PasswordTextBox
public static record PasswordTextBox.State(int length, int caret, int anchor, int maxLength, boolean revealed)
extends Record
A password box's own state in a
ComponentSnapshot. It never holds
the text. Indexes are char indexes into the text, as on the box.-
Constructor Summary
ConstructorsConstructorDescriptionState(int length, int caret, int anchor, int maxLength, boolean revealed) Creates an instance of aStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionintanchor()Returns the value of theanchorrecord component.intcaret()Returns the value of thecaretrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether any text was selected.intlength()Returns the value of thelengthrecord component.intReturns the value of themaxLengthrecord component.booleanrevealed()Returns the value of therevealedrecord component.intReturns the end of the selection.intReturns the start of the selection.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
State
public State(int length, int caret, int anchor, int maxLength, boolean revealed) Creates an instance of aStaterecord class.
-
-
Method Details
-
selectionStart
public int selectionStart()Returns the start of the selection.- Returns:
- the smaller of
caretandanchor
-
selectionEnd
public int selectionEnd()Returns the end of the selection.- Returns:
- the larger of
caretandanchor
-
hasSelection
public boolean hasSelection()Returns whether any text was selected.- Returns:
- true if
caretandanchordiffer
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
length
-
caret
-
anchor
-
maxLength
-
revealed
-