home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / edtplug / classes / netscape / test / plugin / composer / EditHomePage.java < prev    next >
Encoding:
Java Source  |  1998-04-08  |  2.5 KB  |  71 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. package netscape.test.plugin.composer;
  20.  
  21. import netscape.plugin.composer.*;
  22.  
  23. /** Sample Plugin that opens the Netscape Home Page for editing.
  24.  * Shows how to call Document.editURL.
  25.  */
  26.  
  27. public class EditHomePage extends Plugin {
  28.     /** Test the plugin. Not required for normal operation of the plugin.
  29.      * You can use this to run the plugin from the command line:
  30.      * java -classpath <your-class-path> <your-plugin-name> args...
  31.      * where args... are passed on to the Test class.
  32.      * You can remove this code before shipping your plugin.
  33.      */
  34.     static public void main(String[] args) {
  35.         Test.perform(args, new EditHomePage());
  36.     }
  37.     /** Get the human readable name of the plugin. Defaults to the name of the plugin class.
  38.      * @return the human readable name of the plugin.
  39.      */
  40.     public String getName()
  41.     {
  42.         return "Edit Netscape Home Page";
  43.     }
  44.  
  45.     /** Get the human readable category of the plugin. Defaults to the name of the plugin class.
  46.      * @return the human readable category of the plugin.
  47.      */
  48.     public String getCategory()
  49.     {
  50.         return "HTML Tools";
  51.     }
  52.  
  53.     /** Get the human readable hint for the plugin. This is a one-sentence description of
  54.      * what the plugin does. Defaults to the name of the plugin class.
  55.      * @return the human readable hint for the plugin.
  56.      */
  57.     public String getHint()
  58.     {
  59.         return "Edits the Netscape Home Page.";
  60.     }
  61.  
  62.     /** Perform the action of the plugin. This plugin colorizes the selected text.
  63.      *
  64.      * @param document the current document.
  65.      */
  66.     public boolean perform(Document document){
  67.         Document.editDocument("http://www.netscape.com/index.html");
  68.         return true;
  69.     }
  70. }
  71.