Class ResourcefulCheckMenuItem
java.lang.Object
javafx.scene.control.MenuItem
javafx.scene.control.CheckMenuItem
dev.javai18n.fx.ResourcefulCheckMenuItem
- All Implemented Interfaces:
dev.javai18n.core.Localizable.LocaleEventListener, dev.javai18n.core.Resourceful, EventListener, javafx.css.Styleable, javafx.event.EventTarget
public class ResourcefulCheckMenuItem
extends javafx.scene.control.CheckMenuItem
implements dev.javai18n.core.Resourceful, dev.javai18n.core.Localizable.LocaleEventListener
A CheckMenuItem that supports localizing the text and graphic.
-
Property Summary
Properties inherited from class javafx.scene.control.CheckMenuItem
selectedProperties inherited from class javafx.scene.control.MenuItem
accelerator, disable, graphic, id, mnemonicParsing, onAction, onMenuValidation, parentMenu, parentPopup, style, text, visible -
Field Summary
Fields inherited from class javafx.scene.control.MenuItem
MENU_VALIDATION_EVENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionNo-arg constructor for FXML instantiation.protectedResourcefulCheckMenuItem(dev.javai18n.core.Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcefulCheckMenuItemcreate(dev.javai18n.core.Resource resource) Construct a ResourcefulCheckMenuItem with the specified Resource.voiddispose()Unregister this component as a locale-event listener on its resource's source.dev.javai18n.core.Resourceprotected final voidvoidinitialize(dev.javai18n.core.Resource resource) Initialize this component for the FXML path.voidprocessLocaleEvent(dev.javai18n.core.Localizable.LocaleEvent event) voidsetResource(dev.javai18n.core.Resource resource) protected voidMethods inherited from class javafx.scene.control.CheckMenuItem
isSelected, selectedProperty, setSelectedMethods inherited from class javafx.scene.control.MenuItem
acceleratorProperty, addEventFilter, addEventHandler, buildEventDispatchChain, disableProperty, fire, getAccelerator, getCssMetaData, getGraphic, getId, getOnAction, getOnMenuValidation, getParentMenu, getParentPopup, getProperties, getPseudoClassStates, getStyle, getStyleableNode, getStyleableParent, getStyleClass, getText, getTypeSelector, getUserData, graphicProperty, idProperty, isDisable, isMnemonicParsing, isVisible, mnemonicParsingProperty, onActionProperty, onMenuValidationProperty, parentMenuProperty, parentPopupProperty, removeEventFilter, removeEventHandler, setAccelerator, setDisable, setGraphic, setId, setMnemonicParsing, setOnAction, setOnMenuValidation, setParentMenu, setParentPopup, setStyle, setText, setUserData, setVisible, styleProperty, textProperty, toString, visibleProperty
-
Constructor Details
-
ResourcefulCheckMenuItem
protected ResourcefulCheckMenuItem(dev.javai18n.core.Resource resource) -
ResourcefulCheckMenuItem
public ResourcefulCheckMenuItem()No-arg constructor for FXML instantiation. Callinitialize(Resource)from the FXML controller before use.
-
-
Method Details
-
create
Construct a ResourcefulCheckMenuItem with the specified Resource.- Parameters:
resource- A Resource containing a MenuItemPropertyBundle.- Returns:
- A ResourcefulCheckMenuItem with updated Locale-specific values that is registered to listen to LocaleEvents generated from the specified Resource's source.
-
initialize
protected final void initialize() -
initialize
public void initialize(dev.javai18n.core.Resource resource) Initialize this component for the FXML path. Associates the givenResourceand applies its locale-specific values. Must be called exactly once from an FXML controller after FXMLLoader instantiation.- Parameters:
resource- The Resource to associate with this component.- Throws:
IllegalStateException- if called more than once.
-
updateLocaleSpecificValues
protected void updateLocaleSpecificValues() -
processLocaleEvent
public void processLocaleEvent(dev.javai18n.core.Localizable.LocaleEvent event) - Specified by:
processLocaleEventin interfacedev.javai18n.core.Localizable.LocaleEventListener
-
getResource
public dev.javai18n.core.Resource getResource()- Specified by:
getResourcein interfacedev.javai18n.core.Resourceful
-
setResource
public void setResource(dev.javai18n.core.Resource resource) - Specified by:
setResourcein interfacedev.javai18n.core.Resourceful
-
dispose
public void dispose()Unregister this component as a locale-event listener on its resource's source.
-