标签:
Setting up Eclipse to create and debug plugins for ImageJ
最近在做一个关于卫星遥感全链路仿真的项目,由于项目是基于ImageJ开发,而ImageJ提供了强大的插件机制,所以特来写一个东西说明如何将自己的代码转化为ImageJ的插件。
(on my computer the Java SDK library folder is located at C:\Program Files\Java\jdk1.6.0_02\lib)
Create a new plugin (or import your previously developed plugins).
import ij.IJ;
import ij.plugin.PlugIn;
public class TestPlugin_ implements PlugIn {
public void run(String arg) {
IJ.error("Hello world!");
}
}
<project name="TESTPlugin_" default="" basedir=".">
<description>
TESTPlugin_ build file
</description>
<property name="src" location="src" />
<property name="build" location="bin" />
<property name="dist" location="dist" />
<property name="pluginsDir" location="$basedir/../../IJ/plugins/" />
<property name="user.name" value="Patrick Pirrotte" />
<target name="main" depends="compress" description="Main target">
<echo>
Building the .jar file.
</echo>
</target>
<target name="compress" depends="" description="generate the distribution">
<jar jarfile="TESTPlugin_.jar">
<fileset dir="." includes="plugins.config" />
<fileset dir="${build}" includes="**/*.*" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
<copy file="TESTPlugin_.jar" toDir="${pluginsDir}" />
</target>
</project>
后注:当然上文只是其中一种方法,也还有其他方法可以实现!!!
如何在Eclipse中开发并调试自己的插件(或者说如何将自己的代码插件化)
标签:
原文地址:http://www.cnblogs.com/hansonwang99/p/4913238.html