||
At A Glance
|
About This Document
|
Class Description
|
Summaries
|
Properties
|
Methods
|
Events
|
System Properties
|
See Also
||
The HotJava Component Series
HotJava System State Bean
Class At A Glance
Class Name: |
HotJavaSystemState |
Extends: |
Component |
Implements: |
Externalizable |
Purpose
The HotJava System State bean is an
invisible
JavaBeans component
allowing customization and providing persistance for the
HotJava HTML Component.
Key Properties
Creation
Commonly Used Methods
About This Document
Audience
This document describes the HotJava HTML 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
Class Description
Overview
The HotJava System State bean is an
invisible
JavaBeans component
intended for use with the
HotJava HTML Component.
The browser maintains a fair amount of "system state." This
state represents things like system properties (like the HTTP proxy
settings), the URL pool, the Cookie jar, etc. There should be exactly one
HotJava System State bean for the entire VM.
If one is not included, reasonable defaults will be supplied but state cannot be accessed. If more than one is instantiated, the last to write a value will take precedence in each case.
Security
Internationalization
Please note that the system property
user.language
must be set correctly in order for any text other than English to display
correctly. The Java runtime uses this property to
find the correct fonts for a language. If it is not set languages other than English show up as ?'s or empty
boxes.
Introspection
A BeanInfo class, HotJavaSystemStateBeanInfo, explicitly provides information
for properties, events, and methods.
Summaries
Property Summary
Method Summary
Event Summary
As Source
EventListener Interfaces: |
PropertyChangeListener
VetoableChangeListener |
As Listener
The HotJava System State bean does not act as a listener.
Alphabetical Reference
Properties
Methods
-
void addPropertyChangeListener(PropertyChangeListener l, String propertyName)
-
Add a listener for post-notification of changes in a bound property.
See also:
removePropertyChangeListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
-
void addVetoableChangeListener(VetoableChangeListener l, String propertyName)
-
Add a listener for pre-notification of changes in a constrained property.
See also:
removeVetoableChangeListener() ,
addPropertyChangeListener() ,
removePropertyChangeListener() .
-
HotJavaSystemState clone()
-
This method clones the system state bean and returns it.
See also:
HotJavaSystemState()
.
void editUserProperties()
- Launches a dialog to edit the UserProperties property. This is meant
to provide a basic, minimal UI; the application writer
will probably want to create their own dialog to edit system
properties (both for properties relevant to HotJava, and others).
This method may be removed and replaced by something better that
provides equivalent functionality in a later release.
HotJavaSystemState()
-
The default constructor.
See also:
clone().
-
CookieJar getCookies()
-
Get the cookies property. This is a bound and constrained
property. A new cookie is added whenever a new cookie is
received. This is primarily used to provide persistence for cookies,
but, through the veto mechanism, it can also be used to control cookie
use.
See also the
Cookie
and
CookieJar
classes.
See also:
setCookies().
SystemProperties getSystemPropertyDefaults()
- Get the SystemPropertyDefaults property. This allows a
developer to provide default
values for various system properties that control the editor's
appearance, behavior, etc. The bean can be deployed with these
defaults, but the user can override the bean's defaults in
UserProperties. The value of SystemPropertyDefaults is saved
when the HotJavaSystemState bean is serialized.
and .
See also:
System Properties,
setSystemPropertyDefaults(),
System.getProperty().
-
URLPool getURLPool()
-
Get the URLPool property. This is a bound property, set whenever
a new URL is visited. This list is used by the bean to determine the
color of displayed links - links in this list will be displayed in a
different color than all others. If the client wishes this list to be
persistent, it should be saved on shutdown, and set at startup.
URLPool
is a class that contains a collection of
PoolEntry
instances. PoolEntry contains the URL of the document, and an
expiration date. The pool may be discarded by setting it to null.
See also:
setURLPool().
SystemProperties getUserProperties()
- Get the UserProperties property. This is used to set user-specific
values for
system properties
(see also System.getProperty()
in the JDK). This is used for setting things like the HTTP proxy.
It is expected that the application that uses the bean will store
the user's properties in persistant storage, and set the SystemProperties
property at program startup.
See also:
setUserProperties().
-
void removePropertyChangeListener(PropertyChangeListener l, String propertyName)
-
Remove a listener for post-notification of changes in a bound property.
See also:
addPropertyChangeListener(),
addVetoableChangeListener(),
removeVetoableChangeListener().
-
void removeVetoableChangeListener(VetoableChangeListener l, String propertyName)
-
Remove a listener for pre-notification of changes in a constrained property.
See also:
addVetoableChangeListener(),
addPropertyChangeListener(),
removePropertyChangeListener().
-
void setCookies(CookieJar jar)
-
Set the cookies property. This is a bound and constrained
property. A new cookie is added whenever a new cookie is
received. This is primarily used to provide persistence for cookies,
but, through the veto mechanism, it can also be used to control cookie
use.
See also the
Cookie
and
CookieJar
classes.
See also:
getCookies().
void setSystemPropertyDefaults(SystemProperties p)
- Set the SystemPropertyDefaults property. This allows someone
to provide specific default
values for various system properties that control the editor's
appearance, behavior, etc. The bean can be deployed with these
defaults, but the user can override the bean's defaults in
UserProperties. The value of SystemPropertyDefaults is saved
when the HotJavaSystemState bean is serialized. See Appendix A,
and System.getProperty().
See also:
System Properties,
getSystemPropertyDefaults(),
System.getProperty().
-
void setURLPool(URLPool pool)
-
Set the URLPool property. This is a bound property, set whenever
a new URL is visited. This list is used by the bean to determine the
color of displayed links - links in this list will be displayed in a
different color than all others. If the client wishes this list to be
persistent, it should be saved on shutdown, and set at startup.
URLPool
is a class that contains a collection of
PoolEntry
instances. PoolEntry contains the URL of the document, and an
expiration date. The pool may be discarded by setting it to null.
See also:
getURLPool().
void setUserProperties(SystemProperties p)
- Set the UserProperties property. This is used to set user-specific
values for
system properties
(see also System.getProperty()
in the JDK). This is used for setting things like the HTTP proxy.
It is expected that the application that uses the bean will store
the user's properties in persistant storage, and set the SystemProperties
property at program startup.
See also:
getUserProperties().
Events
As Source
EventListener Interfaces: |
PropertyChangeListener
VetoableChangeListener |
EventObjects: |
PropertyChangeEvent |
As Listener
The HotJava System State bean does not act as a listener.
System Properties
Exposed to the User:
These system properties are exposed to the user to set. They control important
aspects of the browser's functioning that a user might want to set
for himself. All of the system properties listed below are also exposed
in a property editor; this allows a developer to provide default
values that the user can override.
- http.proxyHost
- Gives the hostname of the HTTP proxy, if there is one.
- http.proxyPort
- Gives the port number for the HTTP proxy
- ftpProxySet
- If true, indicates that an FTP proxy has been set
- ftpProxyHost
- Gives the hostname of the FTP proxy
- ftpProxyPort
- Gives the port number of the FTP proxy
- gopherProxySet
- If true, indicates that a gopher proxy has been set
- gopherProxyHost
- Gives the hostname of the gopher proxy
- gopherProxyPort
- Gives the port number of the gopher proxy
- home.url
- Ignored. This will be removed in a future release.
- delayAppletLoading
- If true, applets will not be loaded immediately. Instead, an
image will be displayed; clicking on the image will load the
applet.
- delayImageLoading
- If true, images won't be loaded immediately.
- displayBackgroundImages
- Setting this false will disable the display of background images.
- user.language
- The language used by the runtime to retrieve fonts.
Must be set for non-English languages to display correctly.
Exposed to Developers:
These system properties are exposed via a property editor only to developers.
They are in addition to the user properties listed in the previous section.
- fonts.sizes
- Gives a list of thirteen font sizes. These control the sizes
of the fonts that HotJava uses to display HTML text.
- hotjava.docfontsize
- A number between -2 and 2, this acts as an offset into fonts.sizes.
This is typically used to control display font size, with
-2 meaning "very small", and 2 meaning
"very large".
- hotjava.docfont
- The name of the font used to render HTML text.
- hotjava.docbgcolor
- Gives a default value for a document's background color, if the
document doesn't specify it.
- hotjava.curcolor
- Gives the color of the cursor
- hotjava.selcolor
- Gives the color of selected text
- hotjava.alttextcolor
- Gives the color for HTML "alt" attribute text strings
- hotjava.errorcolor
- Gives a color for indicating errors
- anchorStyle
- Should we underline links?
- http.agent
- Sent by the browser on the User-Agent HTTP header
- urlpool.expires
- URLPool entries will expire after this many hours. This is what
causes links to display as "visited."
- hotjava.enableCookies
- If true, the browser will accept HTTP cookies from remote sites.
- hotjava.security.getInterFrameApplets
- If set true, an applet in one frame will be able to access applets
in another frame (but in the same codebase) via
AppletContext.getApplets(). Most browsers disable this, and the
default for HotJava is false.
- trustProxy
- If true, we will trust IP addresses that we can't resolve directly
by ourselves.
- package.restrict.access
- Gives a list of package name prefixes that untrusted applets will not
be able to access. It is crucial that you include
any packages that your application puts on the CLASSPATH in this
property. For example, if your code is in packages starting
with "com.foo," but you also include components in the package
"com.bar," you should set this property to "com.foo, com.bar." If
you fail to do this, untrusted applets will be able to access
any public data members of methods in your classes. If applets
are allowed to define classes in your packages, they'll also be
able to see package-private members. Be sure you set this
property, and be sure that you include the prefixes of all
CLASSPATH classes!
- package.restrict.definition
- Gives a list of package name prefixes that untrusted applets
will not be able to define classes. Normally, this will be
a superset of package.restrict.access. It is extremely
important that you set this property, for reasons
outlined under package.restrict.access.
See Also
Related Topics
||
At A Glance
|
About This Document
|
Class Description
|
Summaries
|
Properties
|
Methods
|
Events
|
System Properties
|
See Also
||
HotJava Components version 1.0