|| At A Glance | About This Document | Class Description | Summaries | Properties | Methods | Events | Supporting Classes | See Also ||
Class Name: | HotJavaBrowserBean |
Extends: | BeanDocumentPanel |
Implements: | Externalizable, ComponentListener, BrowserHistoryListener, Observer, Serializable |
Purpose
Creation
Overview
There is also a normal Java class behind the bean that implements the methods. This class could also be used in Java applications. The danger with this is upward compatibility. If in the future browser functionality is provided as a collection of beans, rather than one, then the panel class becomes obsolete. Compatibility with the monolithic bean component will be maintained via bean aggregation, but the panel class, if used in Java applications, will have no such guarantee.
To support the possible future development directions, the intent is to keep this API as minimal as possible, while providing a full featured product. This is a difficult balance between making it easier to use, and providing an API that won't need to be broken in the future.
Security
A HTML component presents a difficult situation. The Bean specification says that security management is the responsibility of the bean container. Beans that are to be used everywhere need to be able to run under a security manager, while beans that are application specific may not need to. The HTML component is unique in that it is a bean that can have other beans or Java applets within it that can come from unknown sources, i.e. the web. If the HTML component were to just let its container worry about security, as recommended by the Bean specification, you could easily get into a situation where you are browsing the web and running applets totally unprotected. To protect against this, when the bean is instantiated, if it doesn't detect a security manager it will install one. The installed security manager will only affect applets within the bean. This still allows applets to take advantage of a lenient container-supplied security manager, but it does provide good default security behavior. At design time
To deal with secure connections, we need to handle authentication. Dealing with authentication means supplying a user interface, something we are trying to avoid in the bean. As a compromise, we are breaking the monolithic model, and supplying the HotJava Authenticator Bean. This release defines the interface used by this bean, and provides a default implementation. Developers may use this version or override its behavior. If the authenticator bean is not wired into the container, the HTML component will work fine, but it will not be able to connect to secure sites.
CurrentDocument | currentDocument | [constrained][bound] | - the document being displayed | (rw) |
String | documentString | [bound] | - the URL for the current document as a string | (rw) |
URL | documentURL | [bound] | - the URL for the current document | (rw) |
InputStream | documentSource | [bound] | - the input stream for the current document | (rw) |
String | documentTitle | [bound] | - the title of the current document | (ro) |
String | errorMessage | [bound] | - the most recent error | (ro) |
String | statusMessage | [bound] | - the latest status | (ro) |
double | loadingProgress | [bound] | - progress information during document loading | (ro) |
boolean | documentReloadable | [bound] | - true when the document can be reloaded | (ro) |
boolean | secureConnection | [bound] | - true when the current connection is secure | (ro) |
String[] | frameList | [bound] indexed | - the names of all HTML frames | (ro) |
DocumentSelection | selection | [bound] | - the user's current selection | (ro) |
ElementInfo | indicatedElement | [bound] | - the link (if any) under the cursor | (ro) |
String | charset | [bound] | - character set used to translate into Unicode | (rw) |
instantiation | HotJavaBrowserBean()
clone() |
control | find()
print() (2) clearImageCache() executeHistoryCommand() reload() stopLoading() |
accessing the document |
getCurrentDocument()
setCurrentDocument() getDocumentString() setDocumentString() getDocumentURL() setDocumentURL() getDocumentSource() setDocumentSource() |
reading status | getDocumentTitle()
getErrorMessage() getStatusMessage() getLoadingProgress() getSelection() getIndicatedElement() isDocumentReloadable() isSecureConnection() |
accessing frames | getFrameList() (2) |
accessing character set |
getCharset()
setCharset() |
adding/removing listeners | addBrowserHistoryListener()
removeBrowserHistoryListener() addPropertyChangeListener() removePropertyChangeListener() addVetoableChangeListener() removeVetoableChangeListener() |
EventListener Interfaces: | BrowserHistoryListener
PropertyChangeListener VetoableChangeListener |
EventListener Interfaces: | BrowserHistoryListener
ComponentListener |
void addBrowserHistoryListener(BrowserHistoryListener l)
removeBrowserHistoryListener(),
addPropertyChangeListener(),
removePropertyChangeListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
void addPropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener(),
addBrowserHistoryListener(),
removeBrowserHistoryListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
void addVetoableChangeListener(VetoableChangeListener l)
removeVetoableChangeListener(),
addBrowserHistoryListener(),
removeBrowserHistoryListener(),
addPropertyChangeListener() ,
removePropertyChangeListener() .
HotJavaBrowserBean()
.
void executeHistoryCommand(BrowserHistoryEvent evt)
setCharset().
CurrentDocument getCurrentDocument()
setCurrentDocument(),
getDocumentString(),
getDocumentURL().
InputStream getDocumentSource()
setDocumentSource()
.
setDocumentString(),
getDocumentURL(),
getCurrentDocument().
setDocumentURL(),
getDocumentString(),
getCurrentDocument().
String getFrameList(int index)
ElementInfo getIndicatedElement()
getSelection().
isDocumentReloadable()
reload() .
DocumentSelection getSelection()
getIndicatedElement().
clone().
boolean isDocumentReloadable()
reload().
isDocumentReloadable(),
getLoadingProgress(),
stopLoading() .
void removeBrowserHistoryListener(BrowserHistoryListener l)
addBrowserHistoryListener(),
addPropertyChangeListener(),
removePropertyChangeListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
void removePropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener(),
addBrowserHistoryListener(),
removeBrowserHistoryListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
void removeVetoableChangeListener(VetoableChangeListener l)
addVetoableChangeListener(),
addBrowserHistoryListener(),
removeBrowserHistoryListener(),
addPropertyChangeListener(),
removePropertyChangeListener().
void setCharset(String charset)
getCharset().
void setCurrentDocument(CurrentDocument doc)
getCurrentDocument(),
getDocumentString(),
getDocumentURL().
void setDocumentSource(InputStream source)
getDocumentSource().
void setDocumentString(String url)
getDocumentString().
setDocumentURL(),
setCurrentDocument().
getDocumentURL(),
getDocumentString(),
getCurrentDocument().
getLoadingProgress(),
reload().
Communication with the HotJava Document Stack is handled by means of the BrowserHistoryListener interface. Messages of the form executeHistoryCommand() are sent both to the document stack to notify of changes in the current document state or to clear the history.
EventListener Interfaces: | BrowserHistoryListener
PropertyChangeListener VetoableChangeListener |
EventObjects: | BrowserHistoryEvent
PropertyChangeEvent |
This component is also intended to be the target of button pushed and other component activation and therefore implements ComponentListener.
EventListener Interfaces: | BrowserHistoryListener
ComponentListener |
EventObjects: | BrowserHistoryEvent |
class CurrentDocument { public String documentString; // String rep of URL public URL documentURL; // URL public String frameName; // Frame document is displayed in public boolean externalHint; // A hint given if the HTML component thinks // the client should veto the change, and // set this property on a new bean instance, // or an existing instance that contains // the named frame }; class Cookie { public int version; // Cookie version public String attribute; // Attribute name public String value; // Value public String domain; // Domain public String path; // Path public String comment; public Date expires; // Exipration date public boolean secure; // Is this a secure cookie? public static Cookie parseFromString( String cookieString ); public static Cookie[] parseFromString( String cookieString ); public static String[] combineAsStrings( Cookie[] cookieList ); public String toString(); // Convert to string. }; class CookieJar { public CookieJar(Cookie[]); public Cookie[] getCookies(); public boolean isIncrementalChange(CookieJar other); public Cookie entryAdded(CookieJar other); public Cookie entryRemoved(CookieJar other); }; class PoolEntry { public String url; // URL string of entry public Date lastTouched; // Expiration date of entry public String URL; // URL string of entry }; class URLPool { public URLPool(PoolEntry[]); public PoolEntry[] Entries(); public boolean isIncrementalChange(URLPool other); public PoolEntry entryAdded(URLPool other); public PoolEntry entryRemoved(URLPool other); }; class DocumentSelection { public String text; // Text of selection public String html; // HTML of selection }; class ElementInfo { public String imageURL; // Image link public String hrefURL; // HREF link public String altText; // Alt text public MouseEvent event; // source event }; class SystemProperties { public SystemProperties(Hashtable values) public Hashtable getValues() }
|| At A Glance | About This Document | Class Description | Summaries | Properties | Methods | Events | Supporting Classes | See Also ||