IFCTest


This sample plug-in allows the user to view and edit the raw HTML of the document using an IFC dialog box.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.Plugin

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


IFCTest

Creates an instance of the IFCTest class.

Method of

IFCTest class

Syntax

public IFCTest()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


bundle

Gets the contents of the resource bundle.

Method of

IFCTest class

Syntax

public static ResourceBundle bundle()

Description

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.

Returns

Resource bundle for the plug-in.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getCategory

Gets the human readable category of the plug-in.

Method of

IFCTest class

Syntax

public String getCategory()

Returns

The human readable category of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getCategory function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getHint

Gets the human readable hint for the plug-in.

Method of

IFCTest class

Syntax

public String getHint()

Description

The hint is a one-sentence description of what the plug-in does.

Returns

The human readable hint for the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getHint function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getName

Gets the human readable name of the plug-in.

Method of

IFCTest class

Syntax

public String getName()

Returns

The human readable name of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getName function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


main

Tests the plug-in.

Method of

IFCTest class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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


perform

Performs the action of the plug-in.

Method of

IFCTest class

Syntax

public boolean perform(Document document) throws IOException

Parameters

document
Current document

Description

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.

Throws

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


IFCTestBundle


This class is the resource bundle object used in the IFCTest sample.

Class of

netscape.test.plugin.composer package

Superclass

java.util.ListResourceBundle

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


IFCTestBundle

Creates an instance of the IFCTestBundle class.

Method of

IFCTestBundle class

Syntax

public IFCTestBundle()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


getContents

Gets the contents of the test bundle.

Method of

IFCTestBundle class

Syntax

public Object[][] getContents()

Overrides

This function overrides the getContents function in the ListResourceBundle class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


RedirectTest


This sample plug-in shows how to redirect edit requests.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.Plugin

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, Tableize, TagStrip, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


RedirectTest

Creates an instance of the RedirectTest class.

Method of

RedirectTest class

Syntax

public RedirectTest()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


main

Tests the plug-in.

Method of

SmallCaps class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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


perform

Performs the action of the plug-in.

Method of

RedirectTest class

Syntax

public boolean perform(Document document) throws IOException

Parameters

document
Current document

Description

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.

Throws

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


SmallCaps


This sample plug-in implements Netscape-style small caps.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.Plugin

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, Tableize, TagStrip, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


SmallCaps

Creates an instance of the SmallCaps class.

Method of

SmallCaps class

Syntax

public SmallCaps()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


getCategory

Gets the human readable category of the plug-in.

Method of

SmallCaps class

Syntax

public String getCategory()

Returns

The human readable category of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getCategory function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getHint

Gets the human readable hint for the plug-in.

Method of

SmallCaps class

Syntax

public String getHint()

Description

The hint is a one-sentence description of what the plug-in does.

Returns

The human readable hint for the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getHint function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getName

Gets the human readable name of the plug-in.

Method of

SmallCaps class

Syntax

public String getName()

Returns

The human readable name of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getName function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


main

Tests the plug-in.

Method of

SmallCaps class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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


perform

Performs the action of the plug-in.

Method of

SmallCaps class

Syntax

public boolean perform(Document document) throws IOException

Parameters

document
Current document

Description

This function performs the work of the plug-in, in this case, implementing Netscape-style small caps.

Throws

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


Tableize


This sample plug-in places selected text in a table cell, demonstrating low-level parsing of HTML.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.Plugin

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, TagStrip, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


Tableize

Creates an instance of the Tableize class.

Method of

Tableize class

Syntax

public Tableize()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


getCategory

Gets the human readable category of the plug-in.

Method of

Tableize class

Syntax

public String getCategory()

Returns

The human readable category of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getCategory function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getHint

Gets the human readable hint for the plug-in.

Method of

Tableize class

Syntax

public String getHint()

Description

The hint is a one-sentence description of what the plug-in does.

Returns

The human readable hint for the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getHint function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getName

Gets the human readable name of the plug-in.

Method of

Tableize class

Syntax

public String getName()

Returns

The human readable name of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getName function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


main

Tests the plug-in.

Method of

Tableize class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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


perform

Performs the action of the plug-in.

Method of

Tableize class

Syntax

public boolean perform(Document document) throws IOException

Parameters

document
The current document

Description

This function performs the action of the plug-in, which wraps selected text in a table cell.

Throws

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


TagStrip


This sample plug-in strips the HTML tags from selected text in a document, demonstrating low-level HTML parsing.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.Plugin

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, Test, TextImageEncoder

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructors


TagStrip

Constructs an instance of the TagStrip class.

Method of

TagStrip class

Syntax

public TagStrip()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


getCategory

Gets the human readable category of the plug-in.

Method of

TagStrip class

Syntax

public String getCategory()

Returns

The human readable category of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getCategory function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getHint

Gets the human readable hint for the plug-in.

Method of

TagStrip class

Syntax

public String getHint()

Description

The hint is a one-sentence description of what the plug-in does.

Returns

The human readable hint for the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getHint function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


getName

Gets the human readable name of the plug-in.

Method of

TagStrip class

Syntax

public String getName()

Returns

The human readable name of the plug-in. Default: the name of the plug-in class.

Overrides

This function overrides the getName function in the Plugin class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


main

Tests the plug-in.

Method of

TagStrip class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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


perform

Performs the action of the plug-in.

Method of

TagStrip class

Syntax

public boolean perform(Document document) throws IOException

Parameters

document
The current document

Description

This function performs the action of the plug-in, which strips the tags from the selected text.

Throws

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


TextImageEncoder


The TextImageEncoder sample, provided in the Composer Plug-in Kit, is an example of an image encoder.

Class of

netscape.test.plugin.composer package

Superclass

netscape.plugin.composer.ImageEncoder

Description

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


See Also

AddApplet, AddButton, AddLayer, Colorize, DocInfo, DocInfoResources, EditRaw, IFCTest, IFCTestBundle, ImageEncoderTest, RedirectTest, SmallCaps, Tableize, TagStrip, Test

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Constructor


TextImageEncoder

Creates an instance of the TextImageEncoder class.

Method of

TextImageEncoder class

Syntax

public TextImageEncoder()

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


Methods


encode

Encodes the image.

Method of

TextImageEncoder class

Syntax

public boolean encode(ImageProducer input,
                      OutputStream output) throws IOException

Parameters

input
An image producer (standard Java AWT IP class)
output An output stream

Description

This method encodes the image.

Throws

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


getFileExtension

Gets the standard file extension of the image format.

Method of

TextImageEncoder class

Syntax

public String getFileExtension()

Returns

The standard file extension of the image format, for example, .txt.

Overrides

This function overrides the getFileExtension function in the ImageEncoder class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getFileType

Mac OS only

Gets the file type of the image format.

Method of

TextImageEncoder class

Syntax

public void getFileType(byte type[])

Parameters

type
Four byte array for the file type of the image format.

Description

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.

Returns

The Mac OS file type of the image format.

Overrides

This function overrides the getFileType function in the ImageEncoder class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference


getFormatName

Gets the name of the image format.

Method of

TextImageEncoder class

Syntax

public String getFormatName()

Returns

The name of the image format, for example, Text.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


getHint

Gets the human readable hint for the image encoder.

Method of

TextImageEncoder class

Syntax

public String getHint()

Description

The hint is a one-sentence description of what the image encoder does.

Returns

The human readable hint for the image encoder. Default: the name of the plug-in class.

Overrides

This function overrides the getHint function in the ImageEncoder class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


getName

Gets the human readable name of the image encoder.

Method of

TextImageEncoder class

Syntax

public String getName()

Returns

The human readable name of the image encoder. Default: the name of the image encoder class.

Overrides

This function overrides the getName function in the ImageEncoder class.

[Top] [Testbed Package Classes] [Composer Plug-in API Reference]


main

Tests the plug-in.

Method of

TextImageEncoder class

Syntax

public static void main(String args[])

Parameters

args[]
String arguments. For values, see the Test class definition.

Description

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