com.teamdev.jxbrowser
Interface NavigationHistory

All Known Subinterfaces:
Browser
All Known Implementing Classes:
AbstractBrowser

public interface NavigationHistory

The interface provides information about browser navigation history and allows registering listeners to receive all browser navigation change events.


Method Summary
 void addHistoryChangeListener(HistoryChangeListener listener)
          Registers a new listener that will receive all history change events.
 boolean canGoBack()
          Returns true if the backward operation can be invoked.
 boolean canGoForward()
          Returns true if the forward operation can be invoked.
 java.util.List<java.lang.String> getAllHistory()
          Returns a history list that contains all visited locations.
 int getCurrentIndex()
          Returns an index of the location of a currently loaded web page in Browser component.
 java.lang.String getCurrentLocation()
          Returns the location of a currently loaded web page in Browser component.
 java.util.List<HistoryChangeListener> getHistoryChangeListeners()
          Returns all registered listeners that receive navigation change events.
 void removeHistoryChangeListener(HistoryChangeListener listener)
          Unregisters the specified listener so that it will no longer receive history change events.
 

Method Detail

getAllHistory

java.util.List<java.lang.String> getAllHistory()
Returns a history list that contains all visited locations.

Returns:
a history list that contains all visited locations.

getCurrentLocation

java.lang.String getCurrentLocation()
Returns the location of a currently loaded web page in Browser component. The default location is 'about:blank'. So if the history list is empty, then this method always returns 'about:blank' location.

Returns:
the location of a currently loaded web page in Browser component or 'about:blank' if the history list is empty.
See Also:
getAllHistory(), getCurrentIndex()

getCurrentIndex

int getCurrentIndex()
Returns an index of the location of a currently loaded web page in Browser component. Every back or forward operation causes to change the index value in history list. Using this method you can get an index of a web page in navigation history list.

Returns:
an index of a currently loaded web page in navigation history list or -1 when the history list is empty.
See Also:
getAllHistory()

canGoBack

boolean canGoBack()
Returns true if the backward operation can be invoked.

Returns:
true if the backward operation can be invoked.
See Also:
canGoForward()

canGoForward

boolean canGoForward()
Returns true if the forward operation can be invoked.

Returns:
true if the forward operation can be invoked.
See Also:
canGoBack()

addHistoryChangeListener

void addHistoryChangeListener(HistoryChangeListener listener)
Registers a new listener that will receive all history change events.

Parameters:
listener - a listener to register.
See Also:
removeHistoryChangeListener(com.teamdev.jxbrowser.events.HistoryChangeListener)

removeHistoryChangeListener

void removeHistoryChangeListener(HistoryChangeListener listener)
Unregisters the specified listener so that it will no longer receive history change events.

Parameters:
listener - a listener to be removed.
See Also:
addHistoryChangeListener(com.teamdev.jxbrowser.events.HistoryChangeListener)

getHistoryChangeListeners

java.util.List<HistoryChangeListener> getHistoryChangeListeners()
Returns all registered listeners that receive navigation change events.

Returns:
all of the HistoryChangeListeners or an empty list if no ancestor listeners are currently registered.
See Also:
addHistoryChangeListener(com.teamdev.jxbrowser.events.HistoryChangeListener), removeHistoryChangeListener(com.teamdev.jxbrowser.events.HistoryChangeListener)