Interface NavigationHistoryService


  • public interface NavigationHistoryService
    The ToolStateHistoryService maintains a stack of locations that the user has visited via a navigation plugin. It provides methods querying and manipulating this list.
    • Method Detail

      • next

        void next​(Navigatable navigatable)
        Positions the current location to the next location in the history list. If there is no "next" location, the history list remains unchanged.
        Parameters:
        navigatable - the navigatable to be navigated
      • previous

        void previous​(Navigatable navigatable)
        Positions the "current" location to the previous location in the history list. If there is no "previous" location, the history list remains unchanged.
        Parameters:
        navigatable - the navigatable to be navigated
      • next

        void next​(Navigatable navigatable,
                  LocationMemento location)
        Navigates to the given location in the "next" list. If the location is not in the list, then nothing will happen.
        Parameters:
        navigatable - the navigatable to be navigated
        location - The location within the "next" list to which to go
      • previous

        void previous​(Navigatable navigatable,
                      LocationMemento location)
        Navigates to the given location in the "previous" list. If the location is not in the list, then nothing will happen
        Parameters:
        navigatable - the navigatable to be navigated
        location - The location within the "previous" list to which to go.
      • nextFunction

        void nextFunction​(Navigatable navigatable)
        Positions the "current" location to the next location which is in a different function from current one or previous non-code location. If we are not inside any function, performs like "next".
        Parameters:
        navigatable - the navigatable to be navigated
      • previousFunction

        void previousFunction​(Navigatable navigatable)
        Positions the "previous" location to the next location which is in a different function from current one or previous non-code location. If we are not inside any function, performs like "next".
        Parameters:
        navigatable - the navigatable to be navigated
      • getPreviousLocations

        java.util.List<LocationMemento> getPreviousLocations​(Navigatable navigatable)
        Returns the LocationMemento objects in the "previous" list
        Parameters:
        navigatable - the navigatable to be navigated
        Returns:
        the LocationMemento objects in the "previous" list
      • getNextLocations

        java.util.List<LocationMemento> getNextLocations​(Navigatable navigatable)
        Returns the LocationMemento objects in the "next" list
        Parameters:
        navigatable - the navigatable to be navigated
        Returns:
        the LocationMemento objects in the "next" list
      • hasNext

        boolean hasNext​(Navigatable navigatable)
        Returns true if there is a valid "next" location in the history list.
        Parameters:
        navigatable - the navigatable to be navigated
        Returns:
        true if there is a "next" location
      • hasPrevious

        boolean hasPrevious​(Navigatable navigatable)
        Returns true if there is a valid "previous" location in the history list
        Parameters:
        navigatable - the navigatable to be navigated
        Returns:
        true if there is a "previous" location
      • hasNextFunction

        boolean hasNextFunction​(Navigatable navigatable)
        Returns true if there is a valid "next" function location in the history list
        Parameters:
        navigatable - Navigatable object we are looking at
        Returns:
        true if there is a valid "next" function location
      • hasPreviousFunction

        boolean hasPreviousFunction​(Navigatable navigatable)
        Returns true if there is a valid "previous" function location in the history list
        Parameters:
        navigatable - Navigatable object we are looking at
        Returns:
        true if there is a valid "previous" function location
      • addNewLocation

        void addNewLocation​(Navigatable navigatable)
        Adds the given locationMomento to the list of previous locations. Clears the list of next locations.
        Parameters:
        navigatable - the navigatable to be navigated
      • clear

        void clear​(Navigatable navigatable)
        Removes all visited locations from the history list
        Parameters:
        navigatable - the navigatable to be navigated