Class DelegatingEditActionHandlerFocusAdapter
- java.lang.Object
-
- java.awt.event.FocusAdapter
-
- com.inductiveautomation.ignition.designer.model.DelegatingEditActionHandlerFocusAdapter
-
- All Implemented Interfaces:
java.awt.event.FocusListener
,java.util.EventListener
public class DelegatingEditActionHandlerFocusAdapter extends java.awt.event.FocusAdapter
AFocusAdapter
which sets the injectedDelegatingEditActionHandler's
delegate to the injectedEditActionHandler
delegate when the target gains focus. When the target loses focus, theDelegatingEditActionHandler'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 parentComponent
(since focus could be on the Designer's edit menu bar, in this case the edit action delegation chain will not break).- See Also:
SwingUtilities.isDescendingFrom(Component, Component)
-
-
Constructor Summary
Constructors Constructor Description DelegatingEditActionHandlerFocusAdapter(java.awt.Component parent, DelegatingEditActionHandler delegator, EditActionHandler delegate)
Constructor for injecting the parent, delegator, and delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
focusGained(java.awt.event.FocusEvent e)
void
focusLost(java.awt.event.FocusEvent e)
-
-
-
Constructor Detail
-
DelegatingEditActionHandlerFocusAdapter
public DelegatingEditActionHandlerFocusAdapter(java.awt.Component parent, DelegatingEditActionHandler delegator, EditActionHandler delegate) throws java.lang.NullPointerException
Constructor for injecting the parent, delegator, and delegate.- Parameters:
parent
- The parentComponent
delegator
- The delegatordelegate
- The delegate to whom the delegator will delegate handling of edit actions- Throws:
java.lang.NullPointerException
- when parent or delegator is null
-
-
Method Detail
-
focusGained
public void focusGained(java.awt.event.FocusEvent e)
- Specified by:
focusGained
in interfacejava.awt.event.FocusListener
- Overrides:
focusGained
in classjava.awt.event.FocusAdapter
-
focusLost
public void focusLost(java.awt.event.FocusEvent e)
- Specified by:
focusLost
in interfacejava.awt.event.FocusListener
- Overrides:
focusLost
in classjava.awt.event.FocusAdapter
-
-