Class PropCnrFocusEvent

All Implemented Interfaces:
IPostEventProcessing

public class PropCnrFocusEvent extends SinkEvent
The focus event send to the property receiving losing and focus, its listeners and the parents respectively.

Focus processing is done in the following order:

  1. Focus is changed in the focus engine without notification, i.e. the call to IFocusEngine.getCurrentFocus() will reflect the new focus component,
     
  2. If the receiving focus component is non-null: focus veto processing using the focus listeners registered in the IFocusEngine using the IFocusVetoListener interface. If the FocusVetoException is thrown, the original focus is restored in the focus engine without notification.
     
  3. Focus lost sent to the component losing focus using method IFocusComp.onFocusLost(IFocusComp, IGProp, boolean) in the event FocusEvent.
     
  4. Focus lost is notified in a bubbling event PropFocusEvent to the component losing focus and its parents. with PropFocusEvent.isFocusLost() true.
     
  5. Focus lost is notified in a sinking event PropCnrFocusEvent to the component losing focus and its descendants with isFocusLost() true.
     
  6. Focus change sent to the focus listeners registered in the IFocusEngine using IFocusListener.onFocusChanged(FocusEvent).
     
  7. Focus gained sent to the component gaining focus using method IFocusComp.onFocusGained(IFocusComp, IGProp, boolean) in the event FocusEvent.
     
  8. Focus gained is notified in a bubbling event PropFocusEvent to the component gaining focus and its parents. with PropFocusEvent.isFocusGained() true.
     
  9. Focus gained is notified in a sinking event PropCnrFocusEvent to the component gaining focus and its descendants with isFocusGained() true.
     
Author:
Christopher Mindus
  • Constructor Details

    • PropCnrFocusEvent

      public PropCnrFocusEvent(IFocusComp comp, boolean isGained, IFocusComp focusGainedComponent, IFocusComp focusLostComponent, IGProp<?> trigger, boolean isRemoteInduced)
      Constructs a new focus event.
      Parameters:
      comp - The component instance involved in the focus change (losing or gaining focus).
      isGained - Focus gained event.
      focusGainedComponent - The component gaining focus, null for none.
      focusLostComponent - The component losing focus, null for none.
      trigger - The trigger property, null for none.
      isRemoteInduced - Flag indicating this change is induced from a remote party.
  • Method Details

    • getFocusLostComponent

      public IFocusComp getFocusLostComponent()
      Retrieves the opposite component that previously had focus, null for none. In general, this value is only null during application start, but could be null for a while if e.g. a component that had focus is destroyed and no focus can currently be set elsewhere, e.g. because the client session is disconnected.
    • getFocusGainedComponent

      public IFocusComp getFocusGainedComponent()
      Retrieves the component that receives focus, null for none. The focus receiver is set to null if a component that had focus is destroyed and no other focus receiver is found.
    • getTrigger

      public GProp<?> getTrigger()
      Gets the trigger property.
      Overrides:
      getTrigger in class GEvent
      Returns:
      The trigger property, or null for none.
    • isFocusLost

      public boolean isFocusLost()
      Returns if this is a Focus Lost Event.
      Returns:
      true if it is a focus lost event, false for focus gained.
    • isFocusGained

      public boolean isFocusGained()
      Returns if this is a Focus Gained Event.
      Returns:
      true if it is a focus gained event, false for focus lost.
    • requestHistoryEntry

      public void requestHistoryEntry()
      Requests a history event from the focus engine. This will force the focus engines to add a history event when appropriate.
    • isHistoryEntryRequested

      public boolean isHistoryEntryRequested()
      Returns the flag for history entry requested.
      Returns:
      true if somebody has requested a history entry during the event's lifetime.
    • paramString

      protected StringBuilder paramString(StringBuilder buf)
      Returns the parameter string representing the state of this event. This string is useful for debugging. Super classes adds extra information to the string by preceding it with a comma followed by the extra information.
      Overrides:
      paramString in class GEvent
      Parameters:
      buf - The StringBuilder to append the string to.
      Returns:
      The StringBuilder, i.e. the buf input parameter.
    • isClearCacheEvent

      public boolean isClearCacheEvent()
      Returns the state for a property container if this event is received in the onEventSelf method as a helper for it would need to clear the property container cache.
      Overrides:
      isClearCacheEvent in class GEvent
      Returns:
      false, always for this event.