package ijx.plugin;

import java.util.ArrayList;
import java.util.List;

import org.openide.util.lookup.ServiceProvider;

import imagej2.plugin.PluginEntry;
import imagej2.plugin.PluginFinder;

@ServiceProvider(service=PluginFinder.class)
public class IjxPluginFinder implements PluginFinder {

	@Override
	public void findPlugins(List<PluginEntry> plugins) {
		// TODO add real implementation here.
		String pluginClass = "ijx.plugin.FooBar";
		ArrayList<String> parentMenu = new ArrayList<String>();
		parentMenu.add("Plugins");
		parentMenu.add("Foo");
		String label = "Bar";
		PluginEntry entry = new PluginEntry(pluginClass, parentMenu, label);
		plugins.add(entry);
	}

}

@@ -362,16 +362,19 @@
 %09// TODO
+ --
  add rea
@@ -394,17 +394,16 @@
 ion here
-.
 %0A%09%09Strin
@@ -646,16 +646,16 @@
 label);%0A
-
 %09%09plugin
@@ -672,10 +672,453 @@
 y);%0A%09%7D%0A%0A
+%09/**%0A%09 * Tests the IJX plugin discovery mechanism,%0A%09 * printing a list of all discovered plugins.%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Finding plugins...%22);%0A%09%09List%3CPluginEntry%3E plugins = new ArrayList%3CPluginEntry%3E();%0A%09%09new IjxPluginFinder().findPlugins(plugins);%0A%09%09System.out.println(%22Discovered plugins:%22);%0A%09%09for (PluginEntry plugin : plugins) %7B%0A%09%09%09System.out.println(%22%5Ct%22 + plugin);%0A%09%09%7D%0A%09%09System.exit(0);%0A%09%7D%0A%0A
 %7D%0A

Add main method for testing.