Difference between revisions of "Plugin development"

From Freeplane - free mind mapping and knowledge management software
(Created page with '==Create a new Plugin== A simple tool helps to get started with the development of plugins. It's an Ant Task named 'create-plugin' that is available from the <tt>freeplane_frame...')
 
Line 1: Line 1:
==Create a new Plugin==
+
=Create a new Plugin=
  
A simple tool helps to get started with the development of plugins. It's an Ant Task named 'create-plugin' that is available from the <tt>freeplane_framework/ant</tt> directory. The task reads all required parameters from the command line. (If you want to do it non-interactively you have to create your own Ant task like this:
+
A simple tool helps to get started with the development of plugins. It's an Ant Task named 'create-plugin' that is available from the <tt>freeplane_framework/ant</tt> directory.
<pre>
 
  <target name="create-plugin-batch">
 
    <create-plugin baseDir="." pluginname="helloworld" hasAction="true" extensionName="world" />
 
  </target>
 
</pre>
 
  
The following transcript shows input and output of a ''create-plugin'' invocation:
+
===Interactive===
 +
The task reads all required parameters from the command line by default. The following transcript shows input and output of a ''create-plugin'' invocation:
 
<pre>
 
<pre>
 
../1_0_x/freeplane_framework/ant $ ant create-plugin
 
../1_0_x/freeplane_framework/ant $ ant create-plugin
Line 36: Line 32:
  
 
Follow the suggestions in the printed message.
 
Follow the suggestions in the printed message.
 +
 +
 +
===Non-interactive===
 +
 +
If you want to do it non-interactively instead you have to create your own (temporary) Ant task in <tt>freeplane_framework/ant/build.xml</tt> like this:
 +
<pre>
 +
  <target name="create-plugin-batch">
 +
    <create-plugin baseDir="." pluginname="helloworld" hasAction="true" extensionName="world" />
 +
  </target>
 +
</pre>
 +
  
 
[[Category:Developer_Documentation]]
 
[[Category:Developer_Documentation]]

Revision as of 00:05, 5 June 2010

Create a new Plugin

A simple tool helps to get started with the development of plugins. It's an Ant Task named 'create-plugin' that is available from the freeplane_framework/ant directory.

Interactive

The task reads all required parameters from the command line by default. The following transcript shows input and output of a create-plugin invocation:

../1_0_x/freeplane_framework/ant $ ant create-plugin
Buildfile: build.xml

create-plugin:
[create-plugin] => Please enter required plugin name:
helloworld
[create-plugin] => Optional: Does this plugin contribute to the GUI? (yes, no)
yes
[create-plugin] => Optional: name of a new extension to define (xml element like 'icon')?
world
[create-plugin] New plugin created in C:\devel\freeplane-bazaar-repo\1_0_x\freeplane_plugin_helloworld
[create-plugin] What next?
[create-plugin] * import plugin into Eclipse via Import... -> Existing Projects into Workspace
[create-plugin] * add required external jars to C:\devel\freeplane-bazaar-repo\1_0_x\freeplane_plugin_helloworld\lib
[create-plugin] * add required external jars and required Freeplane projects to classpath
[create-plugin] * search for "TODO" in the project and fill the gaps
[create-plugin] * add the following element to freeplane_framework/ant/build.xml:
[create-plugin]   <antcall target="makePlugin" inheritall="false">
[create-plugin]     <param name="anttarget" value="dist"/>
[create-plugin]     <param name="targetdir" value="plugins"/>
[create-plugin]     <param name="plugindir" value="freeplane_plugin_helloworld"/>
[create-plugin]     <param name="pluginname" value="org.freeplane.plugin.helloworld"/>
[create-plugin]   </antcall>

Follow the suggestions in the printed message.


Non-interactive

If you want to do it non-interactively instead you have to create your own (temporary) Ant task in freeplane_framework/ant/build.xml like this:

  <target name="create-plugin-batch">
    <create-plugin baseDir="." pluginname="helloworld" hasAction="true" extensionName="world" />
  </target>