The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search

Java API for WebShell

This document describes the Java API for WebShell, also known as the java webclient.

Overview

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.

Pre mozilla.org history

Requirements

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 and Building the Code

Getting the Code

  1. 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

  1. Build the Mozilla tree using the instructions found at http://www.mozilla.org/build/

  2. 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.

Webclient Binaries

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.

Using the webclient

    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].

Requirements Specification

Requirements Analysis

Current Status

    29 October 1999
    Completed Requirements Analysis.
    15 October 1999
    Working on Requirements Analysis.
    23 September 1999
    Working on, and gathering feedback on Requirements Specification.

References


Ed Burns
Last modified: Mon Nov 01 10:53:08 Pacific Standard Time 1999
Copyright © 1998-1999 The Mozilla Organization.
Last modified November 1, 1999.