This sample plug-in allows the user to view and edit the raw HTML of the document using an IFC dialog box.
netscape.test.plugin.composer package
netscape.plugin.composer.Plugin
IFCTest allows the user to view and edit a document's raw HTML in an IFC dialog box. It shows how to call the Internet Foundation Classes (IFC), and, by extension, any user interface toolkit, from a Composer Plug-in.
This sample uses a Java resource bundle, provided by the IFCTestBundle sample. The IFCTest sample uses the JDK 1.1 standard API for resource bundles and the Character.IsWhiteSpace method. For more information, see "Internationalizing and Localizing Plug-ins" and your Java documentation.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
Note for users of Netscape Navigator 4.0b2
and later versions:
The File Load/Save menu items do not work because Navigator 4.0b2 does
not contain the AWT File Dialog classes.
This table summarizes the members of the IFCTest class:
Constructor | Description |
---|---|
IFCTest() | Creates an instance of the IFCTest class |
Methods | |
bundle() | Gets the contents of the resource bundle |
getCategory() | Gets the human readable category of the plug-in |
getHint() | Gets the human readable hint for the plug-in |
getName() | Gets the human readable name of the plug-in |
main(String[]) | Tests the plug-in |
perform(Document) | Performs the action of the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the IFCTest class.
IFCTest class
public IFCTest()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the contents of the resource bundle.
IFCTest class
public static ResourceBundle bundle()
This method retrieves the contents of the Java resource bundle used by this sample. The resource bundle is provided by the IFCTestBundle sample.
The IFCTest sample uses the JDK 1.1 standard API for resource bundles and the Character.IsWhiteSpace method. For more information, see "Internationalizing and Localizing Plug-ins" and your Java documentation.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable category of the plug-in.
IFCTest class
public String getCategory()
The human readable category of the plug-in. Default: the name of the plug-in class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable hint for the plug-in.
IFCTest class
public String getHint()
The hint is a one-sentence description of what the plug-in does.
The human readable hint for the plug-in. Default: the name of the plug-in class.
This function overrides the getHint function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable name of the plug-in.
IFCTest class
public String getName()
The human readable name of the plug-in. Default: the name of the plug-in class.
This function overrides the getName function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
IFCTest class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your plug-in's perform method if you want to run the plug-in from the command line and test it in the Composer Testbed. You can remove the main method before shipping your plug-in if you like; leaving it will not affect the operation of the plug-in.
To run the plug-in from the command line, use this code:
java -classpath yourClassPath yourPluginName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Performs the action of the plug-in.
IFCTest class
public boolean perform(Document document) throws IOException
document |
Current document |
This function performs the work of the plug-in. This plug-in allows the user to view and edit raw HTML in an IFC dialog box.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This function overrides the perform function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
This class is the resource bundle object used in the IFCTest sample.
netscape.test.plugin.composer package
java.util.ListResourceBundle
This sample plug-in provides a resource bundle object that is used in the IFCTest sample. IFCTest shows how to use the Internet Foundation Classes (IFC) from within a Composer plug-in.
Java resource bundles are used in localization. When you are ready for this step, see "Internationalizing and Localizing Plug-ins" and your Java 1.1 documentation. For more information about using resource bundle classes, see in the class definitions for ListResourceBundle and its parent class ResourceBundle.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
This table summarizes the members of the IFCTestBundle class:
Constructor | Description |
---|---|
IFCTestBundle() | Creates an instance of the IFCTestBundle class |
Method | |
getContents() | Gets the contents of the test bundle |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the IFCTestBundle class.
IFCTestBundle class
public IFCTestBundle()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the contents of the test bundle.
IFCTestBundle class
public Object[][] getContents()
This function overrides the getContents function in the ListResourceBundle class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
This sample plug-in shows how to redirect edit requests.
netscape.test.plugin.composer package
netscape.plugin.composer.Plugin
RedirectTest shows how to use the Document.redirectDocumentOpen method. It works by changing a request to edit pages from a web site into a request to edit pages from an FTP site. This plug-in is registered as an event handler that handles the edit event.
The RedirectTest sample plug-in was written to solve a particular problem. A public web site is updated through FTP rather than through HTTP. This means that the browsing URL is different from the editing URL. For example, the main page has this browsing URL:
http://www.palevich.com/index.html
--and this editing URL:
ftp://palevich@shell3.ba.best.com/users/u1/palevich/public_html/index.html
The plug-in redirects the request to edit pages from the web site into a request to edit pages from the FTP site.
Note:
You must substitute your own URLs in order to use this sample
and save changes to your web pages.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
This table summarizes the members of the RedirectTest class:
Constructor | Description |
---|---|
RedirectTest() | Creates an instance of the RedirectTest class |
Methods | |
main(String[]) | Tests the plug-in |
perform(Document) | Performs the action of the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, Tableize, TagStrip, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the RedirectTest class.
RedirectTest class
public RedirectTest()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
SmallCaps class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your plug-in's perform method if you want to run the plug-in from the command line and test it in the Composer Testbed. You can remove the main method before shipping your plug-in if you like; leaving it will not affect the operation of the plug-in.
To run the plug-in from the command line, use this code:
java -classpath yourClassPath yourPluginName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Performs the action of the plug-in.
RedirectTest class
public boolean perform(Document document) throws IOException
document |
Current document |
This function performs the work of the plug-in, in this case, changing requests to edit pages from a web site into requests to edit pages from an ftp sit.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This function overrides the perform function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
This sample plug-in implements Netscape-style small caps.
netscape.test.plugin.composer package
netscape.plugin.composer.Plugin
SmallCaps places the selected text in Netscape-style small caps as an example of low-level HTML parsing.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
This table summarizes the members of the SmallCaps class:
Constructor | Description |
---|---|
SmallCaps() | Creates an instance of the SmallCaps class |
Methods | |
getCategory() | Gets the human readable category of the plug-in |
getHint() | Gets the human readable hint for the plug-in |
getName() | Gets the human readable name of the plug-in |
main(String[]) | Tests the plug-in |
perform(Document) | Performs the action of the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, Tableize, TagStrip, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the SmallCaps class.
SmallCaps class
public SmallCaps()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable category of the plug-in.
SmallCaps class
public String getCategory()
The human readable category of the plug-in. Default: the name of the plug-in class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable hint for the plug-in.
SmallCaps class
public String getHint()
The hint is a one-sentence description of what the plug-in does.
The human readable hint for the plug-in. Default: the name of the plug-in class.
This function overrides the getHint function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable name of the plug-in.
SmallCaps class
public String getName()
The human readable name of the plug-in. Default: the name of the plug-in class.
This function overrides the getName function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
SmallCaps class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your plug-in's perform method if you want to run the plug-in from the command line and test it in the Composer Testbed. You can remove the main method before shipping your plug-in if you like; leaving it will not affect the operation of the plug-in.
To run the plug-in from the command line, use this code:
java -classpath yourClassPath yourPluginName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Performs the action of the plug-in.
SmallCaps class
public boolean perform(Document document) throws IOException
document |
Current document |
This function performs the work of the plug-in, in this case, implementing Netscape-style small caps.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This functon overrides the perform function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
This sample plug-in places selected text in a table cell, demonstrating low-level parsing of HTML.
netscape.test.plugin.composer package
netscape.plugin.composer.Plugin
Tableize places selected text in a table cell. It creates only one table cell, with a green background, around the selected text. This plug-in can be useful for creating titles or headings.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
This table summarizes the members of the Tableize class:
Constructor | Description |
---|---|
Tableize() | Creates an instance of the Tableize class |
Methods | |
getCategory() | Gets the human readable category of the plug-in |
getHint() | Gets the human readable hint for the plug-in |
getName() | Gets the human readable name of the plug-in |
main(String[]) | Tests the plug-in |
perform(Document) | Performs the action of the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, TagStrip, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the Tableize class.
Tableize class
public Tableize()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable category of the plug-in.
Tableize class
public String getCategory()
The human readable category of the plug-in. Default: the name of the plug-in class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable hint for the plug-in.
Tableize class
public String getHint()
The hint is a one-sentence description of what the plug-in does.
The human readable hint for the plug-in. Default: the name of the plug-in class.
This function overrides the getHint function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable name of the plug-in.
Tableize class
public String getName()
The human readable name of the plug-in. Default: the name of the plug-in class.
This function overrides the getName function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
Tableize class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your plug-in's perform method if you want to run the plug-in from the command line and test it in the Composer Testbed. You can remove the main method before shipping your plug-in if you like; leaving it will not affect the operation of the plug-in.
To run the plug-in from the command line, use this code:
java -classpath yourClassPath yourPluginName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Performs the action of the plug-in.
Tableize class
public boolean perform(Document document) throws IOException
document |
The current document |
This function performs the action of the plug-in, which wraps selected text in a table cell.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This function overrides the perform function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
This sample plug-in strips the HTML tags from selected text in a document, demonstrating low-level HTML parsing.
netscape.test.plugin.composer package
netscape.plugin.composer.Plugin
TagStrip strips tags from the selected text in an HTML document, and is an example of low-level parsing of HTML.
This plug-in can give the user a clean start during HTML formatting of a document. The tags are deleted when they are read into input but are not read back into output.
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see Using the Sample Plug-ins.
This table summarizes the members of the TagStrip class:
Constructor | Description |
---|---|
TagStrip() | Creates an instance of the TagStrip class |
Methods | |
getCategory() | Gets the human readable category of the plug-in |
getHint() | Gets the human readable hint for the plug-in |
getName() | Gets the human readable name of the plug-in |
main(String[]) | Tests the plug-in |
perform(Document) | Performs the action of the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, Test, TextImageEncoder
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Constructs an instance of the TagStrip class.
TagStrip class
public TagStrip()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable category of the plug-in.
TagStrip class
public String getCategory()
The human readable category of the plug-in. Default: the name of the plug-in class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable hint for the plug-in.
TagStrip class
public String getHint()
The hint is a one-sentence description of what the plug-in does.
The human readable hint for the plug-in. Default: the name of the plug-in class.
This function overrides the getHint function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable name of the plug-in.
TagStrip class
public String getName()
The human readable name of the plug-in. Default: the name of the plug-in class.
This function overrides the getName function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
TagStrip class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your plug-in's perform method if you want to run the plug-in from the command line and test it in the Composer Testbed. You can remove the main method before shipping your plug-in if you like; leaving it will not affect the operation of the plug-in.
To run the plug-in from the command line, use this code:
java -classpath yourClassPath yourPluginName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Performs the action of the plug-in.
TagStrip class
public boolean perform(Document document) throws IOException
document |
The current document |
This function performs the action of the plug-in, which strips the tags from the selected text.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This function overrides the perform function in the Plugin class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
The TextImageEncoder sample, provided in the Composer Plug-in Kit, is an example of an image encoder.
netscape.test.plugin.composer package
netscape.plugin.composer.ImageEncoder
This class is a sample image encoder. Image encoders encode image data to match specific image formats. The encoder examines the input data, communicates with the user as necessary, and then writes the encoded image to the output stream.
For more information about image encoders, see the ImageEncoder class. For directions for writing and compiling image encoders, see "Writing and Using Image Encoders."
For an introduction to the sample plug-ins included with the Composer Plug-in Kit, see "Using the Sample Plug-ins."
This table summarizes the members of the TextImageEncoder class:
Constructor | Description |
---|---|
TextImageEncoder() | Creates an instance of the TextImageEncoder class |
Methods | Description |
encode(ImageProducer, OutputStream) | Encodes the image |
getFileExtension() | Gets the standard file extension of the image format |
getFileType(byte[]) | Mac OS only: Gets the file type of the image format |
getFormatName() | Gets the name of the image format |
getHint() | Gets the human readable hint for the image encoder |
getName() | Gets the human readable name of the image encoder |
main(String[]) | Tests the plug-in |
AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Creates an instance of the TextImageEncoder class.
TextImageEncoder class
public TextImageEncoder()
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Encodes the image.
TextImageEncoder class
public boolean encode(ImageProducer input, OutputStream output) throws IOException
input |
An image producer (standard Java AWT IP class) |
output | An output stream |
This method encodes the image.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
Overrides
This function overrides the encode function in the ImageEncoder class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the standard file extension of the image format.
TextImageEncoder class
public String getFileExtension()
The standard file extension of the image format, for example, .txt.
This function overrides the getFileExtension function in the ImageEncoder class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Mac OS only
Gets the file type of the image format.
TextImageEncoder class
public void getFileType(byte type[])
type |
Four byte array for the file type of the image format. |
Like the MIME type, the Mac OS file type is a way of specifying the type of a file. The MIME type is operating system independent, while the Mac OS file type is specific to the Mac OS. An image encoder does not require a MIME type because the file extension returned from getFileExtension is used to determine the MIME type.
To run on the Mac OS, an image encoder must implement getFileType. For more information about file type, refer to your Apple Developer Technical Support or the Apple Macintosh OS documentation.
The Mac OS file type of the image format.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the name of the image format.
TextImageEncoder class
public String getFormatName()
The name of the image format, for example, Text.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable hint for the image encoder.
TextImageEncoder class
public String getHint()
The hint is a one-sentence description of what the image encoder does.
The human readable hint for the image encoder. Default: the name of the plug-in class.
This function overrides the getHint function in the ImageEncoder class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Gets the human readable name of the image encoder.
TextImageEncoder class
public String getName()
The human readable name of the image encoder. Default: the name of the image encoder class.
This function overrides the getName function in the ImageEncoder class.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Tests the plug-in.
TextImageEncoder class
public static void main(String args[])
args[] |
String arguments. For values, see the Test class definition. |
Add this method to your image encoder's perform method if you want to run it from the command line and test it in the Composer Testbed. You can remove the main method before shipping if you like; leaving it will not affect the operation of the image encoder.
To run the image encoder from the command line, use this code:
java -classpath yourClassPath yourImageEncoderName args...
where args is passed to the Test class.
For information about writing the main method and running a plug-in from the command line, see "Preparing for Running in the Testbed." Also, see Test.Main and the main methods of each of the sample plug-in classes that are part of the Testbed package.
[Top] [Testbed Package Classes] [Composer Plug-in API Reference]
Copyright © 1997 Netscape Communications Corporation