ice.storm
Class PseudoHistoryManager

java.lang.Object
  extended byice.storm.PseudoHistoryManager
All Implemented Interfaces:
EventListener, HistoryManager, PropertyChangeListener

public class PseudoHistoryManager
extends Object
implements HistoryManager


Field Summary
protected  StormBase base
           
 
Constructor Summary
PseudoHistoryManager(StormBase sb)
           
 
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[] do_getEntries(String viewportId, Hashtable hash)
           
 HistoryEntry[] getBackEntries(String viewportId)
          Returns the whole back history for the specified Viewport.
 String[] getBackHistory(String viewportId)
          Returns the whole back history for the specified Viewport.
 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)
          Returns the whole forward history for the specified Viewport.
 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 propertyChange(PropertyChangeEvent event)
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected StormBase base
Constructor Detail

PseudoHistoryManager

public PseudoHistoryManager(StormBase sb)
Method Detail

setBackHistorySize

public void setBackHistorySize(int limit)
Description copied from interface: HistoryManager
Sets the limit for the back history size for all Viewports.

Specified by:
setBackHistorySize in interface HistoryManager
Parameters:
limit - the maximum amount of URLs saved for each Viewport.

setForwardHistorySize

public void setForwardHistorySize(int limit)
Description copied from interface: HistoryManager
Sets the limit for the forward history size for all Viewports.

Specified by:
setForwardHistorySize in interface HistoryManager
Parameters:
limit - the maximum amount of URLs saved for each Viewport.

getBackHistorySize

public int getBackHistorySize()
Description copied from interface: HistoryManager
Returns the limit for the back history size for all Viewports.

Specified by:
getBackHistorySize in interface HistoryManager
Returns:
the maximum amount of URLs saved for each Viewport.

getForwardHistorySize

public int getForwardHistorySize()
Description copied from interface: HistoryManager
Returns the limit for the back history size for all Viewports.

Specified by:
getForwardHistorySize in interface HistoryManager
Returns:
the maximum amount of URLs saved for each Viewport.

do_getEntries

public HistoryEntry[] do_getEntries(String viewportId,
                                    Hashtable hash)

getBackEntries

public HistoryEntry[] getBackEntries(String viewportId)
Description copied from interface: HistoryManager
Returns the whole back history for the specified Viewport.

Specified by:
getBackEntries in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getForwardEntries

public HistoryEntry[] getForwardEntries(String viewportId)
Description copied from interface: HistoryManager
Returns the whole forward history for the specified Viewport.

Specified by:
getForwardEntries in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getForwardHistory

public String[] getForwardHistory(String viewportId)
Description copied from interface: HistoryManager
Returns the whole forward history for the specified Viewport.

Specified by:
getForwardHistory in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

getBackHistory

public String[] getBackHistory(String viewportId)
Description copied from interface: HistoryManager
Returns the whole back history for the specified Viewport.

Specified by:
getBackHistory in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
Returns:
the history as an array of Strings.

addToBackHistory

public HistoryEntry addToBackHistory(String viewportId,
                                     String url,
                                     int index)
Description copied from interface: HistoryManager
Adds an entry to the back history.

Specified by:
addToBackHistory in interface HistoryManager
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.

addToForwardHistory

public HistoryEntry addToForwardHistory(String viewportId,
                                        String url,
                                        int index)
Description copied from interface: HistoryManager
Adds an entry to the forward history.

Specified by:
addToForwardHistory in interface HistoryManager
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.

clearAllHistories

public void clearAllHistories()
Description copied from interface: HistoryManager
Clears all the history entries.

Specified by:
clearAllHistories in interface HistoryManager

clearHistoryForViewport

public void clearHistoryForViewport(Viewport v)
Description copied from interface: HistoryManager
Clears the history for the specified Viewport.

Specified by:
clearHistoryForViewport in interface HistoryManager

getCurrentLocation

public String getCurrentLocation(String viewportId)
Description copied from interface: HistoryManager
Returns the current location (url) for the specified Viewport.

Specified by:
getCurrentLocation in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
Returns:
the current url as a String.

reload

public void reload(String viewportId)
Description copied from interface: HistoryManager
Reloads the current page for the specified Viewport.

Specified by:
reload in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.

goBack

public void goBack(String viewportId,
                   int leap)
Description copied from interface: HistoryManager
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.

Specified by:
goBack in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.
leap - the number of pages to go back.

goBack

public void goBack(String viewportId)
Description copied from interface: HistoryManager
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.

Specified by:
goBack in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.

goForward

public void goForward(String viewportId)
Description copied from interface: HistoryManager
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.

Specified by:
goForward in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.

goForward

public void goForward(String viewportId,
                      int leap)
Description copied from interface: HistoryManager
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.

Specified by:
goForward in interface HistoryManager
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)
Description copied from interface: HistoryManager
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.

Specified by:
goingSomewhere in interface HistoryManager
Parameters:
viewportId - the id of the Viewport in question.

canGoBack

public boolean canGoBack(String viewportId)
Description copied from interface: HistoryManager
Checks whether the specified Viewport has a backward history.

Specified by:
canGoBack in interface HistoryManager
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)
Description copied from interface: HistoryManager
Checks whether the specified Viewport has a forward history.

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

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener