In this tutorial, we will be working with Eclipse to create and configure a new Java project called helloworld-demo for the plug-in development. After Eclipse starts, create a new java project. Enter the name of your project. In this tutorial, we name it helloworld-demo. Click "Finish". A folder named helloworld-demo will be created in your workspace directory.
Create New Project
Next step we will import visant.jar into this project. First download the visant.jar and save it somewhere on your file system. Then create a new folder in your project as shown below:
Create New folder for visant.jar

When prompted, call the folder "visant" and click finish to create a new folder in your project.

Right click on your new folder and select "Import."
Import visant.jar
In the Import dialog, select "Fine System" and then "Next" Browser to the directory where visant.jar is located and select the visant.jar.
Select visant.jar
Click "Finish." You should see the visant.jar in your project.
Now to add the visant.jar to the project classpath. Right-cilcik on the project and select "Properties."

Go to the "Libraries" tab in "Java Build Path" Click on "Add JARs...", and navigate to the visant.jar. Click "OK."
Add JARs

Click the "OK" in the Properties dialog to finish this setup.

Now, we can start to write some Java code. Right-click on the your project and select "New" than "Class" in the sub-menu to create a new java class in your project.
Name this new class as "HelloWorld" and click "Browser..." in "Superclass" to specify the super class of this class. In "Superclass Selection" dialog, find AbstractVisANTPlugin in cagt.bu.visant.plug then click "OK."
Setup superclass
Then Click the "Add.." in "Interfaces"to add other interfaces. In the resulting dialog, find "ActionListener" and then click "OK" to add.
Setup Interface

Check the checkbox for "Constructors from superclass" and then Click "Finish."

Your new created class should be show up in an editor window.
Edit java code
Now you can start writing your code. Here is a plug-in example from Plug-in Tutorials.

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import cagt.bu.visant.plugin.AbstractVisANTPlugin;

public class HelloWorld extends AbstractVisANTPlugin implements ActionListener {

	public HelloWorld() {
		JMenuItem helloMenu = new JMenuItem("Hello VisANT Expression");
		// be aware that VisANT do not have a menu named "Expression", therefore
		// following line will create a new menu in VisANT menubar
		addToMenu(helloMenu, "Expression");
		JMenuItem vhelloMenu = new JMenuItem("Hello VisANT Plugins");
		// by default, the menu will be added under menu "Plugins"

	public void actionPerformed(ActionEvent e) {
		if (e.getActionCommand().equals("expression")) {
			JOptionPane.showMessageDialog(null, "Hello VisANT Expression");
		} else {
			JOptionPane.showMessageDialog(null, "Hello VisANT Plugins");


So far, VisANT only support Jar file for plug-ins. When you finish your code, you have to export your project as a jar file before debugging or running. Right click on "visant" folder and select "New -> folder" to create a new folder.
Create folder for plugins
Call the folder "plugins" and click finish to create a new sub-folder in visant directory.
Right-click on the project and select "Export." Select "JAR file" in "Export" dialog and click "Next".
Export Jar
Make sure you check the src folder and uncheck the visant folder in your project. Click "Browse..." to specify the export destination. The output file should be located in the plugins folder where we just create.
Export Setup
In this example, we export our project as helloworld.jar into helloworld-demo/visant/plugins
Click "Finish" and then click "OK" in the next dialog to export your jar file.

Now, we have to setup a run configurations for this project in order to debugging or running. Right click on your project and select "Run as..-> Run configuration." Right click on "Java Application" and select "New" to add a new configuration for this project.
Run configurations
Name this profile as "Helloworld-demo" and click the "Search..." in "Main class:" to specify the main class. Find and select "VisANTApplet" then click "OK" to finish.
Setup main class
Go to "Arguments" tab, click "Other:" in "Working directory" and then click "Workspace" to setup working directory.
Setup working directory
Select the folder, "visant", under your project and then click "OK" to finish.
Click "Apply" and then "Run" to close this dialog and run your plug-in. If your setup is correct, you will see your plug-in in visant. You can either debug or run this project in Eclipse now. To debug, just right click on your project and select "Debug as -> Java Application" to perform debug.

Next step: use Ant script to speed up the plugin compiling and testing

For Further questions, please contact Yi-Chien