ice.storm
Interface HistoryManager

All Superinterfaces:
EventListener, PropertyChangeListener
All Known Implementing Classes:
PseudoHistoryManager

public interface HistoryManager
extends PropertyChangeListener


Method Summary
 HistoryEntry addToBackHistory(String viewportId, String url, int index)
          Adds an entry to the back history.
 HistoryEntry addToForwardHistory(String viewportId, String url, int index)
          Adds an entry to the forward history.
 boolean canGoBack(String viewportId)
          Checks whether the specified Viewport has a backward history.
 boolean canGoForward(String viewportId)
          Checks whether the specified Viewport has a forward history.
 void clearAllHistories()
          Clears all the history entries.
 void clearHistoryForViewport(Viewport v)
          Clears the history for the specified Viewport.
 HistoryEntry[] getBackEntries(String viewportId)
          Returns the whole back history for the specified Viewport.
 String[] getBackHistory(String viewportId)
          Deprecated. Use getBackEntries(String) and HistoryEntry.getURL() instead.
 int getBackHistorySize()
          Returns the limit for the back history size for all Viewports.
 String getCurrentLocation(String viewportId)
          Returns the current location (url) for the specified Viewport.
 HistoryEntry[] getForwardEntries(String viewportId)
          Returns the whole forward history for the specified Viewport.
 String[] getForwardHistory(String viewportId)
          Deprecated. Use getForwardEntries(String) and HistoryEntry.getURL() instead.
 int getForwardHistorySize()
          Returns the limit for the back history size for all Viewports.
 void goBack(String viewportId)
          Displays the previous page in the backward history for the specified Viewport.
 void goBack(String viewportId, int leap)
          Displays the page in the backward history for the specified Viewport and leap.
 void goForward(String viewportId)
          Displays the previous page in the forward history for the specified Viewport.
 void goForward(String viewportId, int leap)
          Displays the page in the forward history for the specified Viewport and leap.
 void goingSomewhere(ContentLoader cl, String viewportId)
          Makes sure that histories are updated if a location is rendered without the use of recorded histories, e.g.
 void reload(String viewportId)
          Reloads the current page for the specified Viewport.
 void setBackHistorySize(int limit)
          Sets the limit for the back history size for all Viewports.
 void setForwardHistorySize(int limit)
          Sets the limit for the forward history size for all Viewports.
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Method Detail

setBackHistorySize

public void setBackHistorySize(int limit)
Sets the limit for the back history size for all Viewports.

Parameters:
limit - the maximum amount of URLs saved for each Viewport.

setForwardHistorySize

public void setForwardHistorySize(int limit)
Sets the limit for the forward history size for all Viewports.

Parameters:
limit - the maximum amount of URLs saved for each Viewport.

getBackHistorySize

public int getBackHistorySize()
Returns the limit for the back history size for all Viewports.

Returns:
the maximum amount of URLs saved for each Viewport.

getForwardHistorySize

public int getForwardHistorySize()
Returns the limit for the back history size for all Viewports.

Returns:
the maximum amount of URLs saved for each Viewport.

getBackHistory

public String[] getBackHistory(String viewportId)
Deprecated. Use getBackEntries(String) and HistoryEntry.getURL() instead.

Returns the whole back history for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getForwardHistory

public String[] getForwardHistory(String viewportId)
Deprecated. Use getForwardEntries(String) and HistoryEntry.getURL() instead.

Returns the whole forward history for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getBackEntries

public HistoryEntry[] getBackEntries(String viewportId)
Returns the whole back history for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getForwardEntries

public HistoryEntry[] getForwardEntries(String viewportId)
Returns the whole forward history for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

addToForwardHistory

public HistoryEntry addToForwardHistory(String viewportId,
                                        String url,
                                        int index)
Adds an entry to the forward history.

Parameters:
viewportId - the id of the Viewport in question.
url - the URL to add to the hostory.
index - the index to add the URL at; 0 is first.
Returns:
the new entry.

addToBackHistory

public HistoryEntry addToBackHistory(String viewportId,
                                     String url,
                                     int index)
Adds an entry to the back history.

Parameters:
viewportId - the id of the Viewport in question.
url - the URL to add to the hostory.
index - the index to add the URL at; 0 is first.
Returns:
the new ntry.

getCurrentLocation

public String getCurrentLocation(String viewportId)
Returns the current location (url) for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
the current url as a String.

reload

public void reload(String viewportId)
Reloads the current page for the specified Viewport.

Parameters:
viewportId - the id of the Viewport in question.

goBack

public void goBack(String viewportId)
Displays the previous page in the backward history for the specified Viewport. This method is called by the deprectaed goBack() method in StormBase, and calls the appropriate methods in StormBase to render the content.

Parameters:
viewportId - the id of the Viewport in question.

goBack

public void goBack(String viewportId,
                   int leap)
Displays the page in the backward history for the specified Viewport and leap. The leap is the number of pages you want to go back with just one method call. The correct url is found and the appropriate methods in StormBase are called to render the content.

Parameters:
viewportId - the id of the Viewport in question.
leap - the number of pages to go back.

goForward

public void goForward(String viewportId)
Displays the previous page in the forward history for the specified Viewport. This method is called by the deprectaed goForward() method in StormBase, and calls the appropriate methods in StormBase to render the content.

Parameters:
viewportId - the id of the Viewport in question.

goForward

public void goForward(String viewportId,
                      int leap)
Displays the page in the forward history for the specified Viewport and leap. The leap is the number of pages you want to go forward with just one method call. The correct url is found and the appropriate methods in StormBase are called to render the content.

Parameters:
viewportId - the id of the Viewport in question.
leap - the number of pages to go forward.

goingSomewhere

public void goingSomewhere(ContentLoader cl,
                           String viewportId)
Makes sure that histories are updated if a location is rendered without the use of recorded histories, e.g. by clicking on a link in an HTML document. This method is called when content is rendered by StormBase.

Parameters:
viewportId - the id of the Viewport in question.

canGoBack

public boolean canGoBack(String viewportId)
Checks whether the specified Viewport has a backward history.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
true if the Viewport has a forward history, false if not.

canGoForward

public boolean canGoForward(String viewportId)
Checks whether the specified Viewport has a forward history.

Parameters:
viewportId - the id of the Viewport in question.
Returns:
true if the Viewport has a forward history, false if not.

clearAllHistories

public void clearAllHistories()
Clears all the history entries.


clearHistoryForViewport

public void clearHistoryForViewport(Viewport v)
Clears the history for the specified Viewport.