org.mozilla.pluglet
Interface Pluglet


public interface Pluglet

A Pluglet is a Plugin written in the Java programming language. It is dispatched when a certain MIME type is encountered by a browser. This interface includes functions to initialize, start, stop, destroy, and print an instance of Pluglet.


Method Summary
 void destroy()
          Called to instruct the Pluglet instance to destroy itself.
 void initialize(PlugletPeer peer)
          Initializes a newly created Pluglet instance, passing to it an instance of PlugletPeer, which it should use for communication with the browser.
 PlugletStreamListener newStream()
          This is called to tell the Pluglet instance that the stream data for an SRC or DATA attribute (corresponding to an EMBED or OBJECT tag) is ready to be read; it is also called for a full-page Pluglet.
 void print(java.awt.print.PrinterJob printerJob)
          Called to instruct the Pluglet instance to print itself to a printer.
 void setWindow(java.awt.Frame frame)
          Called by the browser to set or change the frame containing the Pluglet instance.
 void start()
          Called to instruct the Pluglet instance to start.
 void stop()
          Called to instruct the Pluglet instance to stop and suspend its state.
 

Method Detail

initialize

public void initialize(PlugletPeer peer)
Initializes a newly created Pluglet instance, passing to it an instance of PlugletPeer, which it should use for communication with the browser.

Parameters:
peer - This is the instance of PlugletPeer that should be used for communication with the browser.

start

public void start()
Called to instruct the Pluglet instance to start. This will be called after the Pluglet is first created and initialized, and may be called after the Pluglet is stopped (via the stop() method) if the Pluglet instance is revisited in the browser window's history.

stop

public void stop()
Called to instruct the Pluglet instance to stop and suspend its state. This method will be called whenever the browser window displays another page and the page containing the Pluglet goes into the browser's history list.

destroy

public void destroy()
Called to instruct the Pluglet instance to destroy itself. This is called when it is no longer possible to return to the Pluglet instance -- either because the browser window's history list of pages is being trimmed, or because the window containing this page in the history is being closed.

newStream

public PlugletStreamListener newStream()
This is called to tell the Pluglet instance that the stream data for an SRC or DATA attribute (corresponding to an EMBED or OBJECT tag) is ready to be read; it is also called for a full-page Pluglet. The Pluglet is expected to return an instance of PlugletStreamListener, to which data and notifications will be sent.

Returns:
PlugletStreamListener instance, the listener the browser will use to give the Pluglet the data.

setWindow

public void setWindow(java.awt.Frame frame)
Called by the browser to set or change the frame containing the Pluglet instance.

Parameters:
frame - the Pluglet instance frame that changes.

print

public void print(java.awt.print.PrinterJob printerJob)
Called to instruct the Pluglet instance to print itself to a printer.

Parameters:
printerJob - This is an object of type PrinterJob. It is used to control printing.