Interface IFocusComp

All Superinterfaces:
IGProp<GProp<?>[]>, IPropCnr
All Known Subinterfaces:
IUIFocusComp, IVSComponent, IVSMessageComponent
All Known Implementing Classes:
AbstractContentUIContainer, EditorVirtualSpace, EditorVSAction, EditorVSColumnHeader, EditorVSField, EditorVSGroup, EditorVSRow, EditorVSTable, EMapMarkers, EMLGroup, EMList, EMLItemProp, EMUIHeading, EMUISimpleDialog, EMUISwitch, EMUITabBar, EUIAccordion, EUIButton, EUICalendar, EUICalendarList, EUICheckBox, EUIComboBox, EUIContainer, EUIContextMenu, EUIDateTime, EUIDialog, EUIGauge, EUIImage, EUIImage2, EUIMap, EUIMenu, EUIMenuBar, EUIOutput, EUIPanel, EUIPanelPart, EUIPanelPartCnr, EUIRadioButton, EUISlider, EUISpinner, EUISwapContainer, EUITabContainer, EUITable, EUIText, EUITextArea, EUITitlePane, MapMarkers, MLGroup, MList, MLItemProp, MUIHeading, MUISimpleDialog, MUISwitch, MUITabBar, UIAbstractListChoice, UIAccordion, UIButton, UICalendar, UICalendarList, UICheckBox, UIComboBox, UIContainer, UIContextMenu, UIDateTime, UIDialog, UIGauge, UIImage, UIImage2, UIMap, UIMenu, UIMenuBar, UIOutput, UIPanel, UIPanelBase, UIPanelPart, UIPanelPartCnr, UIRadioButton, UISlider, UISpinner, UISwapContainer, UITabContainer, UITable, UIText, UITextArea, UITitlePane, VirtualSpace, VSAction, VSColumnHeader, VSComponent, VSField, VSGroup, VSRow, VSTable

public interface IFocusComp extends IPropCnr
Interface implemented by components or properties that supports receiving focus. There are two core focus engines in IIZI: one for the VirtualSpace and one for the Panels. In general, the one for panels follow the VirtualSpace focus, but not always.

The VirtualSpace focus engine is common for all parallel and/or dormant sessions that are or may connect to it. This means that if the focus is changed in the VirtualSpace, the Panels may receive a focus change also, dependent on the panel connected.

The Panel focus engine is unique for the client session connection, but is kept for a reconnecting session. Changing panel focus may result in changes in the VirtualSpace focus.

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 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 PropCnrFocusEvent.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 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 PropCnrFocusEvent.isFocusGained() true.
     
Author:
Christopher Mindus
  • Method Details

    • requestFocus

      default String requestFocus()
      Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.

      This method is less precise than requestFocusEx(), but avoids try-catching.

      Returns:
      null for success, otherwise an error message indicating why focus was not able to be changed.
    • requestFocusEx

      default boolean requestFocusEx() throws FocusException
      Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.
      Returns:
      true if focus was changed, false otherwise.
      Throws:
      FocusException - If focus could not be changed.
    • requestFocus

      default String requestFocus(IGProp<?> trigger)
      Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.

      This method is less precise than requestFocusEx(IGProp), but avoids try-catching.

      Parameters:
      trigger - The component triggering the focus, null for none.
      Returns:
      null for success, otherwise an error message indicating why focus was not able to be changed.
    • requestFocusEx

      default boolean requestFocusEx(IGProp<?> trigger) throws FocusException
      Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.
      Parameters:
      trigger - The component triggering the focus, null for none.
      Returns:
      true if focus was changed, false otherwise.
      Throws:
      FocusException - If focus could not be changed.
    • onFocusLost

      default void onFocusLost(IFocusComp focusComp, IGProp<?> trigger, boolean isRemoteInduced)
      Called to the focused component when it loses focus.

      Focus components override this method if they need to process focus lost.

      Parameters:
      focusComp - Component receiving focus, null for none.
      trigger - The component triggering the focus, null for none.
      isRemoteInduced - Flag indicating this event is due to a remote event.
    • onFocusGained

      default void onFocusGained(IFocusComp opposite, IGProp<?> trigger, boolean isRemoteInduced)
      Called to the component when it receives focus.

      Focus components override this method if they need to process focus lost.

      Parameters:
      opposite - Component losing focus, null for none.
      trigger - The component triggering the focus, null for none.
      isRemoteInduced - Flag indicating this event is due to a remote event.