Package com.microstrategy.web.app.beans
Class PageHistoryList
- java.lang.Object
-
- com.microstrategy.utils.serialization.AbstractPersistable
-
- com.microstrategy.web.app.beans.PageHistoryList
-
- All Implemented Interfaces:
EnumWebPersistableState
,Persistable
public class PageHistoryList extends AbstractPersistable
Class that represents the page history to be used on the Back/Forward buttons.
Contains a list ofPageHistoryItem
- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
-
Fields inherited from class com.microstrategy.utils.serialization.AbstractPersistable
scriptEndTagEncoder
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Constructor Summary
Constructors Constructor Description PageHistoryList()
PageHistoryList(AppContext appContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.void
clearForwardPages()
Clear all pages after current positionprotected void
doFlatState(FlatStateSerializer serializer, int howMuchState, FlatStateTokenizer tokenizer)
java.util.List<java.lang.String>
getBackHistoryPages()
java.util.List<java.lang.String>
getForwardHistoryPages()
PageHistoryItem
getPage(int relativePageNumber)
Return the page located at the relative index specified.boolean
isNextAvailable()
boolean
isPreviousAvailable()
PageHistoryItem
peekPage(int relativePageNumber)
Return the page located at the relative index specified.void
setCapacity(int capacity)
Sets the size of the page history listvoid
setOutOfBounds(boolean value)
Sets the list in an out of bounds state.-
Methods inherited from class com.microstrategy.utils.serialization.AbstractPersistable
doFlatState, getStateHandler, isXMLStateZipped, restoreState, restoreState, restoreXMLState, saveState, saveState, saveState, saveState, saveXMLState, saveXMLState
-
-
-
-
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 addreplaceExistingPage
- 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
-
doFlatState
protected void doFlatState(FlatStateSerializer serializer, int howMuchState, FlatStateTokenizer tokenizer)
- Overrides:
doFlatState
in classAbstractPersistable
-
-