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
Returnstrueif the control is aTextInputControl.- Specified by:
supportsin interfaceControlBinder- Parameters:
control- the control to check- Returns:
trueif the control is a TextInputControl instance, otherwisefalse
-
bind
Binds thepromptTextPropertyof theTextInputControlto 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:
bindin interfaceControlBinder- Parameters:
control- the control to bindkey- the language key used to retrieve localized text from the resource bundle
-