Class LayoutFactory.PropertyChangeMenuItem

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants
Enclosing class:
LayoutFactory

public static class LayoutFactory.PropertyChangeMenuItem extends JMenuItem
A JMenuItem that listens for changes of background color, foreground color and font of the given JComponent and adapts it's own settings.

Author:
Achim Westermann
See Also:
  • Constructor Details

    • PropertyChangeMenuItem

      public PropertyChangeMenuItem(JComponent component, Action action, LayoutFactory.BasicPropertyAdaptSupport.IRemoveAsListenerFromComponentCondition quitListeningOnBasicPropertyChangesControl)
      Creates an instance with the given name that listens to the components background color, foreground color and font.

      Parameters:
      component - The component to whose background color this item will adapt.
      action - The Action to trigger when this item is clicked.
      quitListeningOnBasicPropertyChangesControl - used to decide when to stop listening on the component (adaptee) for basic property changes.
  • Method Details

    • getUIAdaptee

      public JComponent getUIAdaptee()
      Returns the adaptee this menu item adapts basic UI properties to if still not garbage collected or null.

      Returns:
      the adaptee this menu item adapts basic UI properties to if still not garbage collected or null.