SHIVA.Plugin (r1.1 vs. r1.3)
Diffs

 <<O>>  Difference Topic Plugin (r1.3 - 06 Jan 2006 - Main.HengYuan)

META TOPICPARENT DOC

Steps to create a plugin

Line: 16 to 16

of loading the plugins may be important since some plugins depend on other plugins to work.
Added:
>
>

For example:

package foo;

import shiva.interfaces.ShivaPlugin;

public class DemoPlugin implements ShivaPlugin
{
    public final static String PLUGIN_DESCRIPTION = "A Plugin Demo";

    public static void start ()
    {
        System.out.println ("==== Hello World! ====");
    }
}

Then in shiva/resources/start.xml, add the following line

    <load plugin="foo.DemoPlugin"/>

At this point, the plugin can be loaded by SHIVA.

For specific types of plugins, check the following links:


 <<O>>  Difference Topic Plugin (r1.2 - 13 Sep 2005 - Main.HengYuan)

META TOPICPARENT DOC
Changed:
<
<
Steps to create a plugin
>
>

Steps to create a plugin


Added:
>
>
  1. Implement shiva.interfaces.ShivaPlugin.
  2. Have
    public final static String PLUGIN_DESCRIPTION = "Some Description";
    in the class.
  3. Define entry functions
    public final static start (String config)
    or
    public final static start ()
    in the class.
  4. Specify the plugin class to be loaded in shiva/resources/start.xml. For example,
       <load plugin="shiva.plugins.ColorMapLoader" config="shiva/resources/colormap.xml"/>
    or
       <load plugin="shiva.plugins.About"/>
    The two styles correspond to two different entry functions defined above. The order of loading the plugins may be important since some plugins depend on other plugins to work.

Changed:
<
<
1. implement shiva.interfaces.ShivaPlugin interface 2. have public final static String PLUGIN_DESCRIPTION = "About Shiva"; 3. in shiva/resources/start.xml specify the plugin class:
>
>
At this point, the plugin can be loaded by SHIVA.

Changed:
<
<
4. for menu/toolbar command type of plugins, in "start()" function, you do
  1. shiva.Main.addCommand ("comandName", command)
  2. if it is a toggle comamand and you intend to use it along with other plugins, need to modify shiva/resources/command.xml to indicate command group
  3. to add the command to the menu, modify shiva/resources/menu.xml
  4. to add the command to the toolbar, modify shiva/resources/toolbar.xml
>
>
For specific types of plugins, check the following links:
  1. AddCommand Add actions to menu and toolbars.
  2. ReaderWriter Add new file filters.


 <<O>>  Difference Topic Plugin (r1.1 - 13 Sep 2005 - Main.HengYuan)
Line: 1 to 1
Added:
>
>
META TOPICPARENT DOC
Steps to create a plugin

1. implement shiva.interfaces.ShivaPlugin interface 2. have public final static String PLUGIN_DESCRIPTION = "About Shiva"; 3. in shiva/resources/start.xml specify the plugin class:

4. for menu/toolbar command type of plugins, in "start()" function, you do

  1. shiva.Main.addCommand ("comandName", command)
  2. if it is a toggle comamand and you intend to use it along with other plugins, need to modify shiva/resources/command.xml to indicate command group
  3. to add the command to the menu, modify shiva/resources/menu.xml
  4. to add the command to the toolbar, modify shiva/resources/toolbar.xml

Topic: Plugin . { View | Diffs | r1.3 | > | r1.2 | > | r1.1 | More }

Revision r1.1 - 13 Sep 2005 - 19:36 - Main.HengYuan
Revision r1.3 - 06 Jan 2006 - 22:55 - Main.HengYuan