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

    selected

    Properties 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

    Constructors
    Modifier
    Constructor
    Description
     
    No-arg constructor for FXML instantiation.
    protected
    ResourcefulCheckMenuItem(dev.javai18n.core.Resource resource)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(dev.javai18n.core.Resource resource)
    Construct a ResourcefulCheckMenuItem with the specified Resource.
    void
    Unregister this component as a locale-event listener on its resource's source.
    dev.javai18n.core.Resource
     
    protected final void
     
    void
    initialize(dev.javai18n.core.Resource resource)
    Initialize this component for the FXML path.
    void
    processLocaleEvent(dev.javai18n.core.Localizable.LocaleEvent event)
     
    void
    setResource(dev.javai18n.core.Resource resource)
     
    protected void
     

    Methods inherited from class javafx.scene.control.CheckMenuItem

    isSelected, selectedProperty, setSelected

    Methods 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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ResourcefulCheckMenuItem

      protected ResourcefulCheckMenuItem(dev.javai18n.core.Resource resource)
    • ResourcefulCheckMenuItem

      public ResourcefulCheckMenuItem()
      No-arg constructor for FXML instantiation. Call initialize(Resource) from the FXML controller before use.
  • Method Details

    • create

      public static ResourcefulCheckMenuItem create(dev.javai18n.core.Resource resource)
      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 given Resource and 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:
      processLocaleEvent in interface dev.javai18n.core.Localizable.LocaleEventListener
    • getResource

      public dev.javai18n.core.Resource getResource()
      Specified by:
      getResource in interface dev.javai18n.core.Resourceful
    • setResource

      public void setResource(dev.javai18n.core.Resource resource)
      Specified by:
      setResource in interface dev.javai18n.core.Resourceful
    • dispose

      public void dispose()
      Unregister this component as a locale-event listener on its resource's source.