Interface IFocusEngine

    • Method Detail

      • hasCommonFocus

        boolean hasCommonFocus()
        Checks if this focus engine is common to all parallel client sessions. E.g. the VirtualSpace engine returns true, and the Panel engine returns false.
        Returns:
        true if the focus engine is common to all parallel client session, false otherwise.
      • requestFocus

        java.lang.String requestFocus​(IFocusComp comp,
                                      IGProp<?> trigger,
                                      boolean isRemoteInduced,
                                      IFocusVetoListener callback)
        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(IFocusComp, IGProp, boolean, IFocusVetoListener), but avoid try-catching.

        Parameters:
        comp - The component requesting focus.
        trigger - The trigger property, null for none.
        isRemoteInduced - Flag for remote induced focus.
        callback - Optional callback that may throw a veto exception, null for none. This callback is intended to perform focus changes in the tree, typically for UI containers.
        Returns:
        null for success, otherwise an error message indicating why focus was not able to be changed.
        Throws:
        java.lang.NullPointerException - If comp is null.
      • requestFocusEx

        boolean requestFocusEx​(IFocusComp comp,
                               IGProp<?> trigger,
                               boolean isRemoteInduced,
                               IFocusVetoListener callback)
                        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:
        comp - The component requesting focus.
        trigger - The trigger property, null for none.
        isRemoteInduced - Flag for remote induced focus.
        callback - Optional callback that may throw a veto exception, null for none. This callback is intended to perform focus changes in the tree, typically for UI containers.
        Returns:
        true if focus was changed, false otherwise.
        Throws:
        FocusException - If focus could not be changed.
        java.lang.NullPointerException - If comp is null.
      • getCurrentFocus

        IFocusComp getCurrentFocus()
        Gets the component in focus.
        Returns:
        The component or property in current focus, null for none.
      • addFocusListener

        boolean addFocusListener​(IFocusListener listener)
        Adds a focus listener to the engine.
        Parameters:
        listener - The focus listener.
        Returns:
        true if the listener is added, false if already added as a listener previously.
      • addFocusVetoListener

        boolean addFocusVetoListener​(IFocusVetoListener listener)
        Adds a veto focus listener to the engine.
        Parameters:
        listener - The veto focus listener.
        Returns:
        true if the listener is added, false if already added as a listener previously.
      • removeFocusListener

        boolean removeFocusListener​(IFocusListener listener)
        Removes a focus listener from the engine.
        Parameters:
        listener - The focus listener.
        Returns:
        true if the listener is removed, false if not present.
      • removeFocusVetoListener

        boolean removeFocusVetoListener​(IFocusVetoListener listener)
        Removes a veto focus listener from the engine.
        Parameters:
        listener - The veto focus listener.
        Returns:
        true if the listener is removed, false if not present.
      • getFocusListeners

        IFocusListener[] getFocusListeners()
        Gets the current focus listeners.
        Returns:
        An array of the focus listeners.
      • getFocusVetoListeners

        IFocusVetoListener[] getFocusVetoListeners()
        Gets the current veto focus listeners.
        Returns:
        An array of the veto focus listeners.