Class LabeledBinder
java.lang.Object
io.github.snoopy137.languagemanager.binding.LabeledBinder
- All Implemented Interfaces:
ControlBinder
Binds the
textProperty of Labeled controls (e.g., Label,
Button, CheckBox) to language keys.
This binder checks whether a given control is an instance of Labeled
and binds its text to the language bundle using the provided key.
- Since:
- 1.1.0
- Author:
- alan
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LabeledBinder
public LabeledBinder()
-
-
Method Details
-
supports
Returnstrueif the control is aLabeled.- Specified by:
supportsin interfaceControlBinder- Parameters:
control- the control to check- Returns:
trueif the control is a Labeled instance, otherwisefalse
-
bind
Binds thetextPropertyof theLabeledcontrol to the given language key.If the key is not present in the language bundle, the current text of the control will be used as the default.
- Specified by:
bindin interfaceControlBinder- Parameters:
control- the control to bindkey- the language key used to retrieve localized text from the resource bundle
-