| Class Name: | HotjavaDocumentStack |
| Extends: | Object |
| Implements: | Serializable, BrowserHistoryListener |
Purpose
The HotJavaDocumentStack is an invisible JavaBean that maintains a stack of URLs describing "documents." It is intended for use with the HotJava HTML Component. It is typically combined with user interface controls to provide the "forward" and "back" behavior seen in HotJava and other Web browsers.Key Properties
logicalDepth - How many documents deep is the stack?Creation
contentsDepth - How many documents deep is document state kept?
nextDocumentAvailable - is there a next document for which to enable a "Forward" button?
previousDocumentAvailable - is there a previous document for which to enable a "Back" button?
HotjavaDocumentStack()Commonly Used Methods
executeHistoryCommand() - process a history command.
nextDocument() - go forward to the next document.
previousDocument() - go back to the previous document.
This document describes the HotJava Document Stack JavaBean component. It is intended for both "component assemblers" who will be instantiating and connecting the bean in builder applications as well as Java developers who will be programatically accessing the component. It assumes that you are already familiar with JavaBeans. If terms like property, event, method, introspection, or serialization are unfamiliar, you may want to refer to the JavaBeans documentation or take the JavaBeans tutorial.Table of Contents
Overview
The document stack is an invisible bean intended for use with the HotJava HTML Component. It provides the record necessary for the "forward" and "back" navigation familiar to Web browsers.IntrospectionThe document stack bean is simply a collection of the "documents" visited by the user. It can process a number of history commands to push a document on the stack or clear the history. Methods are provided to go to the previous and next documents, and to indicate the existence of next and previous to allow enabling and disabling controls as appropriate.
A BeanInfo class, HotjavaDocumentStackBeanInfo, explicitly provides information for properties, events, and methods.Example Use
Instantiate a HotjavaDocumentStack, HotJava HTML Component, and two buttons. Label one button "Forward" and bind its buttonPushed event to the nextDocument() method of the document stack. Label the other "Back" and set it to activate previousDocument(). Connect the executeHistoryCommand event for HTML component to the corresponding method of the document stack. Do the same in reverse from the executeHistoryCommand event of the document stack to the method of the HTML component.
| boolean | logicalDepth | - How many documents deep is the stack? | (rw) | |
| boolean | contentsDepth | - How many documents deep is document state kept? | (rw) | |
| boolean | nextDocumentAvailable | [bound] | - is there a next document? | (rw) |
| boolean | previousDocumentAvailable | [bound] | - is there a previous document? | (rw) |
| instantiation | HotjavaDocumentStack() |
| navigation | nextDocument()
previousDocument() |
| state accessors | isNextAvailable()
setNextAvailable() isPreviousAvailable() setPreviousAvailable() |
| adding/removing document history | eraseDocumentHistory()
executeHistoryCommand() |
| adding/removing listeners | addBrowserHistoryListener()
removeBrowserHistoryListener() addPropertyChangeListener() removePropertyChangeListener() |
As Listener
EventListener Interfaces: PropertyChangeListener
BrowserHistoryListener
EventListener Interfaces: BrowserHistoryListener
void addBrowserHistoryListener(BrowserHistoryListener l)
removeBrowserHistoryListener().
void addPropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener().
void eraseDocumentHistory()
void executeHistoryCommand(BrowserHistoryEvent evt)
int getContentsDepth()
setContentsDepth().
int getLogicalDepth()
setLogicalDepth().
HotjavaDocumentStack()
boolean isNextAvailable()
setNextAvailable().
boolean isPreviousAvailable()
setPreviousAvailable().
void nextDocument()
void previousDocument()
void removeBrowserHistoryListener(BrowserHistoryListener l)
addBrowserHistoryListener().
void removePropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener().
void setContentsDepth(boolean val)
getContentsDepth().
void setLogicalDepth(boolean val)
getLogicalDepth().
void setNextAvailable(boolean val)
isNextAvailable().
void setPreviousAvailable(boolean val)
isPreviousAvailable().
The two document stack properties are bound. Therefore, notification of change to next/previous document availablity is multicast with a PropertyChangedEvent to any PropertyChangeListener registered using addPropertyChangeListener().As ListenerBrowserHistoryEvent objects are sent to registered BrowserHistoryListeners to notify of changes in the "current document" due to nextDocument() and previousDocument() actions.
EventListener Interfaces: PropertyChangeListener
BrowserHistoryListenerEventObjects: PropertyChangeEvent
BrowserHistoryEvent
The document stack receives executeHistoryCommand() messages in order to add documents as they are visited in the browser and to clear its history when requested.
EventListener Interfaces: BrowserHistoryListener EventObjects: BrowserHistoryEvent
HotJava Browser Components
HotJava Authenticator Bean
HotJava HTML Component
HotJava System State Bean