|
|
Java API for WebShell
This document describes the Java API for WebShell, also known as the
java webclient.
Mission Statement:
The webclient project aims to provide the premier browser-neutral
Java API that enables generic web browsing capability. This capability
includes, but is not limited to: web content rendering, navigation,
a history mechanism, and progress notification. The actual capabilities
implemented depend on the underlying browser implementation. |
This section describes the requirements you need before building the
webclient project.
- JDK1.1.7 or later (on Linux, you will need JDK1.2 or later)
- a built mozilla tree from later than 5 October 1999
- a built mozilla java util package
Getting the Code
- You must first grab the latest mozilla and webclient code
This can be found at http://www.mozilla.org/cvs.html, but instead of
cvs checkout SeaMonkeyAll use cvs checkout SeaMonkeyBlackwood
Building the Code
- Build the Mozilla tree using the instructions found at http://www.mozilla.org/build/
- Follow the steps in the mozilla/java/README and
mozilla/java/webclient/README files.
NOTE: At this point only debug builds (MOZ_DEBUG=1) are known
to work. Also, the build is only currently designed for NT4.0 and
Linux, but Solaris support is coming soon. If you make changes to the
build to get it to work on other platforms, mail them to me.
If you're unable to compile webclient's native code, we have made
binaries available on the following platforms. They are provided as
a convenience and are not guaranteed to work.
- win32: built with 10/29/99 mozilla. Place the dll in the
mozilla bin directory.
webclient.dll Then
examine the install target of
webclient/src/Makefile.win to discern how to
invoke the main class properly.
There is an example browser in the java-webclient distribution
that illustrates how to use the basic webclient features. This
class is included by reference here [1] for your convenience. Note
that the referenced document may be out of date with respect to
the actual source tree.
You may also want to visit the web presentation, given at Codestock, about
webclient. http://www.mozilla.org/projects/blackwood/webclient/codestock/index.htm
Basically, you create yourself a
BrowserControlCanvas, which is a subclass of
java.awt.Canvas, and add it into your display
hierarchy.
// Create the browser
BrowserControlCanvas browser =
BrowserControlCanvasFactory.newBrowserControlCanvas();
add(browser, BorderLayout.CENTER);
public void actionPerformed (ActionEvent evt) {
String command = evt.getActionCommand();
try {
if (command.equals("Back")) {
if (browserControl.canBack()) {
browserControl.back();
int index = browserControl.getHistoryIndex();
String newURL = browserControl.getURL(index);
System.out.println(newURL);
urlField.setText(newURL);
}
}
else if (command.equals("Forward")) {
if (browserControl.canForward()) {
browserControl.forward();
int index = browserControl.getHistoryIndex();
String newURL = browserControl.getURL(index);
System.out.println(newURL);
urlField.setText(newURL);
}
}
else if (command.equals("Stop")) {
browserControl.stop();
}
else {
browserControl.loadURL(urlField.getText());
}
}
catch (Exception e) {
System.out.println(e.toString());
}
} // actionPerformed()
API documentation is available here, [2].
- 7 January 2000
Trying to get webclient working on Win32 and Solaris at
the same time.
Added a notes page, accessible here. I'll try to update
this page as soon as I have news about webclient.
- 29 October 1999
- Completed Requirements Analysis.
- 15 October 1999
- Working on Requirements Analysis.
- 23 September 1999
- Working on, and gathering feedback on Requirements
Specification.
Ed Burns
Last modified: Fri Jan 07 12:29:11 Pacific Standard Time 2000
|