Login  Register

Re: Programatic Plugin installation

Posted by dscho on Jun 28, 2006; 5:01pm
URL: http://imagej.273.s1.nabble.com/Programatic-Plugin-installation-tp3702389p3702391.html

Hi,

On Wed, 28 Jun 2006, Tom Larkworthy wrote:

> How do I install macro tools from another plugin?
> Currently I am doing:-
>
> MacroInstaller installer = new ij.plugin.MacroInstaller();
>
> installer.install(ROIBrush_.MACRO_CMD);      //MACRO_CMD contains the macro
> definition as it would appear in a macro.txt file
> installer.install(LabelBrush_.MACRO_CMD);
> But only the last called macro tool appears in the toolbar. i.e. in this
> case the  LabelBrush_ tool appears, but if I reversed the calling order then
> the ROIBrush would be the only one that appeared in the toolbar.

The MacroInstaller seems to get confused when being called several times.
However, you can do this:

        new MacroInstaller().install(ROIBrush_.MACRO_CMD + "\n" +
                LabelBrush_.MACRO_CMD);

i.e. you can install more than one tool per call to
MacroInstaller.install();

Hth,
Dscho