Wrapplet
Wrapplet
(the Wrapper Applet)
is a Java 1.1 compatible applet that
acts as a 'host' for other 'guest' applets.
Features
Wrapplet features include:
- Providing a number of improvements over standard applet methods.
- Allows guest applet(s) to be configured by URL.
Note that the URL parameters then apply to any applets on the page
that are embedded in a
Wrapplet. Properties that were
private to an applet instance, now become shared across all guest applets
that allow for query based parameters.
- Provides version checking for guest applets, with fall-back.
The fall-back options include:
- Inbuilt Label message.
- Adding another applet.
This applet might..
- Put a customized 'version too low' message.
- Put a customized 'version too low' message, with help (redirect) button.
- Pop a warning dialog (for an applet that has very small WxH).
- Put a lesser version of the original applet (e.g. AWT rather than Swing).
- Redirect to another page.
- Allows the guest applet to be 'floated' by user choice.
Version History
- 2008-08-03. 0.1. First official form of
Wrapplet released.
Test & demo pages tidied and expanded. Two downloadable Zip files
were added. The first contains the entire file set of deployment jars,
test/demo jars, and the pages that tie them all together and describe them
(the pages you see on the pscode.org site, without the menus or stylesheets).
The second archive contains only the deployment related binaries (jar files).
- 2008-08-01. 0.1-beta. The working files were released to answer a question
on the Sun forums.
Changes to applet methods
Change applet methods..
showDocument(URL) falls back to JS redirect.
A number of problems have been observed in using the standard
applet method to redirect (i.e. it fails without warning), so
we add this secondary method to back it up.
- The standard
getDocumentBase() method sometimes
returns the full URL with query parameters, but usually trims the
query parameters.
We have yet to figure the exact circumstances that determine which it
will be, so we revert to using a JS based method to retrieve the entire
URL reliably.
getParameter(String) usually returns only parameters defined
within the applet element that invoked the applet, but by choice at deployment time,
we can specify to allow parameters in the applet element to be changed by
the equivalent parameter in the URL's query fragment.
These improvements rely on hooking into the
JSObject (by adding the MAYSCRIPT flag
to the applet element), which provides:
- Redirects (fall-back)
- Full URL (including query).
See Also
- The
Wrapplet demo shows the applet
deployed with a variety of options. The demos use TestApplet
as the guest applet.
- The Swing based
TestApplet demo
(plain, with no - Wrapplet wrapper)
URLTransformer demo
shows the transformations that are currently supported. Note that while the
URLTransformer class itself is designed for Java 1.1, we use
a Swing based JTable to represent the transforms.
MessageDialog demo. An AWT
based, Java 1.1 compatible JOptionPane style dialog.
JumpButton demo. The recommended
way to handle 'version too low'. It does not 'break the back button' in the
way that the VersionCheck does, but instead leaves any redirection
to user action (clicking the button).
VersionCheck applet.
VersionCheck could be used as a complete alternative to
wrapping the applet in Wrapplet, or as the 'fallbackApplet'
to load in case of a Java version too low to run the main applet.
Download
- wrapplet-demo.zip contains the deployment
files, along with the web pages that demonstrate them, and the 'test' and 'demo'
jars used specifically for those demos.
- wrapplet-deploy.zip contains
only the jars required for deployment.
|