Class MenuUtilities.MenuPropertyListener

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener
    Enclosing class:
    MenuUtilities

    public static class MenuUtilities.MenuPropertyListener
    extends java.lang.Object
    implements java.beans.PropertyChangeListener
    Listener to track changes in the menu items. Once any property has been changed, the popup layout metrics on the menu item and its parent popup menu are cleared.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Runnable cleanLayoutMetricsRunnable
      Runnable instance to clean the layout metrics.
      private javax.swing.JMenuItem menuItem
      Associated menu item.
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuPropertyListener​(javax.swing.JMenuItem menuItem)
      Creates a new listener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void install()
      Installs the property change listener on the associated menu item.
      void propertyChange​(java.beans.PropertyChangeEvent evt)  
      void uninstall()
      Uninstalls the property change listener from the associated menu item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • menuItem

        private javax.swing.JMenuItem menuItem
        Associated menu item.
      • cleanLayoutMetricsRunnable

        private java.lang.Runnable cleanLayoutMetricsRunnable
        Runnable instance to clean the layout metrics.
    • Constructor Detail

      • MenuPropertyListener

        public MenuPropertyListener​(javax.swing.JMenuItem menuItem)
        Creates a new listener.
        Parameters:
        menuItem - Menu item.
    • Method Detail

      • install

        public void install()
        Installs the property change listener on the associated menu item.
      • uninstall

        public void uninstall()
        Uninstalls the property change listener from the associated menu item.
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener