Class PageHistoryList

    • Constructor Detail

      • PageHistoryList

        public PageHistoryList()
      • PageHistoryList

        public PageHistoryList​(AppContext appContext)
    • Method Detail

      • addPage

        public void addPage​(PageHistoryItem page)
        Adds a page after the current page and clears the end of the collection if the page is different to the current page.
        If adding a page in the middle of the collection and the key of the new page is the same as the existing page in the collection, it will replace the page
        Parameters:
        page - page to add
      • addPage

        public void addPage​(PageHistoryItem page,
                            boolean replaceExistingPage)
        Adds a page after the current page and clears the end of the collection if the page is different to the current page.
        If adding a page in the middle of the collection and the key of the new page is the same as the existing page in the collection, it will replace the page
        Parameters:
        page - page to add
        replaceExistingPage - whether to replace the existing page
      • isNextAvailable

        public boolean isNextAvailable()
        Returns:
        whether there is a next (forward) element on the page history
      • isPreviousAvailable

        public boolean isPreviousAvailable()
        Returns:
        whether there is a previous (back) element on the page history
      • setOutOfBounds

        public void setOutOfBounds​(boolean value)
        Sets the list in an out of bounds state. This mean that the current page is not being saved so going back means going to the current page
        Parameters:
        value - whether the list is out of bounds
      • getPage

        public PageHistoryItem getPage​(int relativePageNumber)
        Return the page located at the relative index specified.
        The page returned becomes the current page on the collection.
        Parameters:
        relativePageNumber - the relative page number (0 for current, -1 for previous, +1 for next)
        Returns:
        the respective history page
      • peekPage

        public PageHistoryItem peekPage​(int relativePageNumber)
        Return the page located at the relative index specified.
        Parameters:
        relativePageNumber - the relative page number (0 for current, -1 for previous, +1 for next)
        Returns:
        the respective history page
      • getBackHistoryPages

        public java.util.List<java.lang.String> getBackHistoryPages()
        Returns:
        a List containing a collection of page titles located previously to the current one on the page history list.
      • getForwardHistoryPages

        public java.util.List<java.lang.String> getForwardHistoryPages()
        Returns:
        a List containing a collection of page titles located subsecuently to the current one on the page history list.
      • setCapacity

        public void setCapacity​(int capacity)
        Sets the size of the page history list
        Parameters:
        capacity -
      • clearForwardPages

        public void clearForwardPages()
        Clear all pages after current position