Class TextInputBinder
java.lang.Object
io.github.snoopy137.languagemanager.binding.TextInputBinder
- All Implemented Interfaces:
ControlBinder
Binds the
promptTextProperty
of TextInputControl
controls
(e.g., TextField, TextArea, PasswordField) to language keys.
This binder appends ".prompt"
to the provided key to locate the
prompt message in the resource bundle. If the key is not found, the current
prompt text is used as default.
- Since:
- 1.1.0
- Author:
- alan
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TextInputBinder
public TextInputBinder()
-
-
Method Details
-
supports
Returnstrue
if the control is aTextInputControl
.- Specified by:
supports
in interfaceControlBinder
- Parameters:
control
- the control to check- Returns:
true
if the control is a TextInputControl instance, otherwisefalse
-
bind
Binds thepromptTextProperty
of theTextInputControl
to the language key.The key is modified by appending
".prompt"
to fetch the appropriate entry from the language bundle. If the key is not found, the existing prompt text is retained.- Specified by:
bind
in interfaceControlBinder
- Parameters:
control
- the control to bindkey
- the language key used to retrieve localized text from the resource bundle
-