public class DelegatingEditActionHandlerFocusAdapter
extends java.awt.event.FocusAdapter
FocusAdapter
which sets the injected
DelegatingEditActionHandler's
delegate to the injected
EditActionHandler
delegate when the target gains focus. When the target
loses focus, the
DelegatingEditActionHandler's
delegate is set to null only if its
delegate is still set to the injected delegate and if the component that the
target lost focus to descends from the injected parent
Component
(since focus could be on the Designer's
edit menu bar, in this case the edit action delegation chain will not break).DelegatingEditActionHandler#setDelegate(EditActionHandler)}
,
SwingUtilities.isDescendingFrom(Component, Component)
Constructor and Description |
---|
DelegatingEditActionHandlerFocusAdapter(java.awt.Component parent,
DelegatingEditActionHandler delegator,
EditActionHandler delegate)
Constructor for injecting the parent, delegator, and delegate.
|
Modifier and Type | Method and Description |
---|---|
void |
focusGained(java.awt.event.FocusEvent e) |
void |
focusLost(java.awt.event.FocusEvent e) |
public DelegatingEditActionHandlerFocusAdapter(java.awt.Component parent, DelegatingEditActionHandler delegator, EditActionHandler delegate) throws java.lang.NullPointerException
parent
- The parent Component
delegator
- The delegatordelegate
- The delegate to whom the delegator will delegate handling of
edit actionsjava.lang.NullPointerException
- when parent or delegator is nullDelegatingEditActionHandlerFocusAdapter}
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
focusGained
in class java.awt.event.FocusAdapter
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
focusLost
in class java.awt.event.FocusAdapter