Login  Register

Re: placement of non-plugin utility classes

Posted by Wayne Rasband on Jul 19, 2006; 4:44pm
URL: http://imagej.273.s1.nabble.com/placement-of-non-plugin-utility-classes-tp3702100p3702103.html

Utility classes should be packaged as a JAR file. Such JAR files can be
placed in the Plugins folder or any immediate sub-folder. If the
utility class is in the benutil package then the it needs to be in a
benutil directory in the JAR file.

-wayne

> This works very easily. I have a follow-up question.  But first I
> should describe what I have done so far.
>
> I can get the following plugin
> ImageJ/plugins/Ben/myPlugin_.class
>
> to work with
> ImageJ/plugins/Ben/benutil/myUtility.class
>
> using the package declarations and syntax like in the example...
>
> package benutil;
> <other stuff>
> someResult = benutil.myUtility.myMethod();
>
>
> I was thinking that I could place the utility class in the
> ImageJ/plugins/Utilities/myUtility.class
>
> That would change the package and method call to
>
> package Utilities;
> <other stuff>
> someResult = Utilities.myUtility.myMethod();
>
> But myUtility.class is not found when I run
> ImageJ/plugins/Ben/myPlugin_.class
>
> It seems that the package has to reside within the directory (or
> subdirectory) where myPlugin.class resides.
>
> So my question what is the conventional organization of projects
> within the ImageJ/plugins/ so that utility classes are universally
> accessible?
>
> Thanks and cheers,
> Ben
>