Class ContextMenuBinder
java.lang.Object
io.github.snoopy137.languagemanager.binding.ContextMenuBinder
- All Implemented Interfaces:
ControlBinder
Binds the
textProperty
of MenuItem
s inside a
ContextMenu
to language keys.
This binder checks whether a given control is an instance of
ContextMenu
and binds the text of its MenuItem
s 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
Returnstrue
if the control is aContextMenu
.- Specified by:
supports
in interfaceControlBinder
- Parameters:
control
- the control to check- Returns:
true
if the control is a ContextMenu, otherwisefalse
-
bind
Binds thetextProperty
of allMenuItem
s inside theContextMenu
to language keys based on their IDs.- Specified by:
bind
in interfaceControlBinder
- Parameters:
control
- the control to bindkey
- the language key used to retrieve localized text from the resource bundle
-