Class ContextMenuBinder
java.lang.Object
io.github.snoopy137.languagemanager.binding.ContextMenuBinder
- All Implemented Interfaces:
ControlBinder
Binds the
textProperty of MenuItems inside a
ContextMenu to language keys.
This binder checks whether a given control is an instance of
ContextMenu and binds the text of its MenuItems using the
provided key as a prefix. Each item's key is expected to be in the format
prefix.itemId.
For example, if the prefix is fileMenu and a MenuItem has an
ID of open, the full key will be fileMenu.open.
- Since:
- 1.1.0
- Author:
- alan
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ContextMenuBinder
public ContextMenuBinder()
-
-
Method Details
-
supports
Returnstrueif the control is aContextMenu.- Specified by:
supportsin interfaceControlBinder- Parameters:
control- the control to check- Returns:
trueif the control is a ContextMenu, otherwisefalse
-
bind
Binds thetextPropertyof allMenuItems inside theContextMenuto language keys based on their IDs.- Specified by:
bindin interfaceControlBinder- Parameters:
control- the control to bindkey- the language key used to retrieve localized text from the resource bundle
-