Class AppHistoryEntry

  • All Implemented Interfaces:
    IAppHistoryEntry

    public class AppHistoryEntry
    extends java.lang.Object
    implements IAppHistoryEntry
    An entry in the application history.

    It is used for backward and optionally forward navigation. The main purpose for this class is to provide information for programmatical use. The information held in this class is fed from the IAppSessionGyro instance.

    Author:
    Christopher Mindus
    • Method Detail

      • setBackwardInfo

        public boolean setBackwardInfo​(UIComp uiComp)
        Sets the backward UI focus information for the entry. It is recommended to also set the VirtualSpace component too, using setBackwardInfo(IVSComponent).
        Specified by:
        setBackwardInfo in interface IAppHistoryEntry
        Parameters:
        uiComp - The UI component, null for none.
        Returns:
        true for changed values, false for no changes.
        Throws:
        java.lang.NullPointerException - If the parameter is null.
        java.lang.IllegalArgumentException - If the parameter is not valid.
      • setForwardInfo

        public boolean setForwardInfo​(UIComp uiComp)
        Sets the forward UI focus information for the entry. It is recommended to also set the VirtualSpace component too, using setForwardInfo(IVSComponent).
        Specified by:
        setForwardInfo in interface IAppHistoryEntry
        Parameters:
        uiComp - The UI component, null for none.
        Returns:
        true for changed values, false for no changes.
        Throws:
        java.lang.NullPointerException - If the parameter is null.
        java.lang.IllegalArgumentException - If the parameter is not valid.
      • setBackwardInfo

        public boolean setBackwardInfo​(IVSComponent vsComp)
        Sets the backward VirtualSpace focus information for the entry.
        Specified by:
        setBackwardInfo in interface IAppHistoryEntry
        Parameters:
        vsComp - The VS component, null for none.
        Returns:
        true for changed values, false for no changes.
        Throws:
        java.lang.NullPointerException - If the parameter is null.
        java.lang.IllegalArgumentException - If the parameter is not valid.
      • setForwardInfo

        public boolean setForwardInfo​(IVSComponent vsComp)
        Sets the forward VirtualSpace focus information for the entry.
        Specified by:
        setForwardInfo in interface IAppHistoryEntry
        Parameters:
        vsComp - The VS component, null for none.
        Returns:
        true for changed values, false for no changes.
        Throws:
        java.lang.NullPointerException - If the parameter is null.
      • setBackwardInfo

        public boolean setBackwardInfo​(IAppHistoryBackward backward)
        Sets the backward programmatic operation to use for the entry.
        Specified by:
        setBackwardInfo in interface IAppHistoryEntry
        Parameters:
        backward - The instance of the backward operation to use or null for none.
        Returns:
        true for changed values, false for no changes.
      • setForwardInfo

        public boolean setForwardInfo​(IAppHistoryForward forward)
        Sets the forward programmatic operation to use for the entry.
        Specified by:
        setForwardInfo in interface IAppHistoryEntry
        Parameters:
        forward - The instance of the backward operation to use or null for none.
        Returns:
        true for changed values, false for no changes.
      • setBackwardAnimation

        public boolean setBackwardAnimation​(int animation)
        Sets the backward panel animation.
        Specified by:
        setBackwardAnimation in interface IAppHistoryEntry
        Parameters:
        animation - The animation value, or -1 for none.
        Returns:
        true if value changed, false for no change.
        Throws:
        java.lang.IllegalArgumentException - If the animation value is not acceptable, i.e. is not a value that comes from the IUIPanelAnimation class.
      • setForwardAnimation

        public boolean setForwardAnimation​(int animation)
        Sets the forward panel animation.
        Specified by:
        setForwardAnimation in interface IAppHistoryEntry
        Parameters:
        animation - The animation value, or -1 for none.
        Returns:
        true if value changed, false for no change.
        Throws:
        java.lang.IllegalArgumentException - If the animation value is not acceptable, i.e. is not a value that comes from the IUIPanelAnimation class.
      • getBackwardUIFocus

        public java.lang.String getBackwardUIFocus()
        Gets the UI reference to the backward focus.
        Specified by:
        getBackwardUIFocus in interface IAppHistoryEntry
        Returns:
        The property reference for the backward UI focus, null for none.
      • getForwardUIFocus

        public java.lang.String getForwardUIFocus()
        Gets the UI reference to the forward focus.
        Specified by:
        getForwardUIFocus in interface IAppHistoryEntry
        Returns:
        The property reference for the forward UI focus, null for none.
      • getBackwardVSFocus

        public IVSComponent getBackwardVSFocus()
        Gets the non-virtualized VS component for backward focus.
        Specified by:
        getBackwardVSFocus in interface IAppHistoryEntry
        Returns:
        The non-virtualized VS component for backward focus, null for none.
      • getForwardVSFocus

        public IVSComponent getForwardVSFocus()
        Gets the non-virtualized VS component for forward focus.
        Specified by:
        getForwardVSFocus in interface IAppHistoryEntry
        Returns:
        The non-virtualized VS component for forward focus, null for none.
      • getBackwardAnimation

        public int getBackwardAnimation()
        Gets the backward panel animation.
        Specified by:
        getBackwardAnimation in interface IAppHistoryEntry
        Returns:
        The panel animation, or -1 for none.
      • getForwardAnimation

        public int getForwardAnimation()
        Gets the forward panel animation.
        Specified by:
        getForwardAnimation in interface IAppHistoryEntry
        Returns:
        The panel animation, or -1 for none.
      • isBackwardEnabled

        public java.lang.String isBackwardEnabled​(IClientSessionGyro clientGyro)
        Returns if the backward operation is enabled or not.

        If a null String is returned, the operation is enabled, otherwise the string is the reason why to operation is disabled. This reason is used typically for developers, logging and debugging.

        Specified by:
        isBackwardEnabled in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the backward operation enabled state.
        Returns:
        Default null meaning enabled, otherwise the reason string for being disabled.
      • isForwardEnabled

        public java.lang.String isForwardEnabled​(IClientSessionGyro clientGyro)
        Returns if the forward operation is enabled or not.

        If a null String is returned, the operation is enabled, otherwise the string is the reason why to operation is disabled. This reason is used typically for developers, logging and debugging.

        Specified by:
        isForwardEnabled in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the forward operation enabled state.
        Returns:
        Default null meaning enabled, otherwise the reason string for being disabled.
      • performBackward

        public java.lang.String performBackward​(IClientSessionGyro clientGyro,
                                                IAppHistoryOperationCompleted completedCallback)
        Performs the backward operation for the client session in question.

        Note: this operation may be lengthy and may not complete in the same thread. This means that the completedCallback could be called from another thread.

        Specified by:
        performBackward in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the backward operation execution.
        completedCallback - The callback is called when operation has completed, null for none.
        Returns:
        Default null meaning enabled and the operation has begun (perhaps not completed yet), otherwise the reason string for being disabled.
      • performForward

        public java.lang.String performForward​(IClientSessionGyro clientGyro,
                                               IAppHistoryOperationCompleted completedCallback)
        Performs the forward operation for the client session in question.

        Note: this operation may be lengthy and may not complete in the same thread. This means that the completedCallback could be called from another thread.

        Specified by:
        performForward in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the forward operation execution.
        completedCallback - The callback is called when operation has completed, null for none.
        Returns:
        Default null meaning enabled and the operation has begun (perhaps not completed yet), otherwise the reason string for being disabled.
      • setBackwardFocus

        public java.lang.String setBackwardFocus​(IClientSessionGyro clientGyro)
        Sets the focus to the backward UI component if possible, otherwise the VS component.

        Focus is set as:

        1. If the UI component is defined, the currently open panels will be used to verify if this reference matches, and if so, that component will be focused. If it didn't match, or in case the request focus operation failed, the UI component will not be used for focusing, rather step 2 below.
        2. If the VS component is specified, it will be used to set the focus, and perhaps virtualized a VirtualSpace and/or panel(s).

        This method is intended to be used if the programmatic operations instance needs to set the focus from the data saved in this history entry.

        Specified by:
        setBackwardFocus in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the forward operation execution.
        Returns:
        Failure string, i.e. null for success, otherwise an error message.
      • setForwardFocus

        public java.lang.String setForwardFocus​(IClientSessionGyro clientGyro)
        Sets the focus to the forward UI component if possible, otherwise the VS component.

        Focus is set as:

        1. If the UI component is defined, the currently open panels will be used to verify if this reference matches, and if so, that component will be focused. If it didn't match, or in case the request focus operation failed, the UI component will not be used for focusing, rather step 2 below.
        2. If the VS component is specified, it will be used to set the focus, and perhaps virtualized a VirtualSpace and/or panel(s).

        This method is intended to be used if the programmatic operations instance needs to set the focus from the data saved in this history entry.

        Specified by:
        setForwardFocus in interface IAppHistoryEntry
        Parameters:
        clientGyro - The client session requesting the forward operation execution.
        Returns:
        Failure string, i.e. null for success, otherwise an error message.
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if another history entry is equal with this one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The other history entry.
        Returns:
        true if all are equal in references and forward/backward information.
      • hashCode

        public int hashCode()
        Gets the hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code is calculated on the focus and omits the client session in question.