java.lang.Object
atlantafx.base.util.MaskTextFormatter.MaskTextFilter
- All Implemented Interfaces:
Function<javafx.scene.control.TextFormatter.Change,,javafx.scene.control.TextFormatter.Change> UnaryOperator<javafx.scene.control.TextFormatter.Change>
- Enclosing class:
- MaskTextFormatter
protected static class MaskTextFormatter.MaskTextFilter
extends Object
implements UnaryOperator<javafx.scene.control.TextFormatter.Change>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadjustCaretPosition(javafx.scene.control.TextFormatter.Change change) javafx.scene.control.TextFormatter.Changeapply(javafx.scene.control.TextFormatter.Change change) protected @Nullable StringcorrectAddedText(javafx.scene.control.TextFormatter.Change change) Corrects added text.protected @Nullable javafx.scene.control.TextFormatter.ChangecorrectContentChange(javafx.scene.control.TextFormatter.Change change) Corrects and returns the content change if it matches the mask.protected StringcorrectDeletedText(javafx.scene.control.TextFormatter.Change change) Corrects the deleted text.protected @Nullable StringcorrectReplacedText(javafx.scene.control.TextFormatter.Change change) Corrects the replaced text.voidboolean
-
Field Details
-
mask
-
ignoreFilter
protected boolean ignoreFilter
-
-
Constructor Details
-
MaskTextFilter
-
-
Method Details
-
isInternalChange
public boolean isInternalChange() -
doInternalChange
-
apply
public javafx.scene.control.TextFormatter.Change apply(javafx.scene.control.TextFormatter.Change change) -
correctContentChange
@Nullable protected @Nullable javafx.scene.control.TextFormatter.Change correctContentChange(javafx.scene.control.TextFormatter.Change change) Corrects and returns the content change if it matches the mask. Otherwise, returns null to drop the change. -
correctReplacedText
@Nullable protected @Nullable String correctReplacedText(javafx.scene.control.TextFormatter.Change change) Corrects the replaced text. For any replaced character it checks whether it matches the mask character at the same position and appliesMaskChar.transform(char). if true. If not, returns null, thus signifying that added text is not valid. -
correctAddedText
@Nullable protected @Nullable String correctAddedText(javafx.scene.control.TextFormatter.Change change) Corrects added text. For any input character it checks whether it matches the mask character at the same position and appliesMaskChar.transform(char). if true. If not, returns null, thus signifying that added text is not valid. -
correctDeletedText
Corrects the deleted text. Basically, replaces all deleted characters with placeholders and returns the resulting text which is always not null. -
adjustCaretPosition
protected void adjustCaretPosition(javafx.scene.control.TextFormatter.Change change)
-