Re: Packages and Calling Plugins from within Plugins
Posted by Albert Cardona on
URL: http://imagej.273.s1.nabble.com/Packages-and-Calling-Plugins-from-within-Plugins-tp3700779p3700780.html
Hi Austin,
Yes it is possible to call plugins from other plugins.
If their .class files are in the classpath, just create a new instance
such as:
PlugIn pl = new Whatever_Plugin();
pl.run(the_args_here);
If their .class files are NOT in the classpath, you can search for them
in a loop starting at the path given to you by the
ij.Menus.getPluginsPath() method, and then load the class with a
ClassLoader and invoke the constructor.
If you'd rather modify the .java source files instead, then group them
all in a folder and give each a package name such as package
my_folder_name; (note the package name has to be the same as the folder
name).
There are many ways to do what you want. Depending upon your expertise
and convenience or flexibility requirements, choose.
Albert