Ticket #1445 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Add support for pure java methods of running plugins

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b4-plugins
Component: Plugins Version:
Severity: serious Keywords:
Cc: curtis Blocked By:
Blocking: #1052

Description

After some discussion it was decided that the plugin service will not run a given plugin instance. Instead if the user desires to run a plugin instance they will be responsible for populating all its fields and and call plugin.run() directly.

The general approach is for a plugin to also have a constructor that takes an ImageJ context. From there it can find all the services it needs (and fail gracefully if not). Then the user runs publicly provided setters as needed followed by run().

We could simplify the the assignment of services by placing it in a base class (like DynamicPlugin or a new class like DirectPlugin). This base class could walk it's Parameter list and populate all Service fields.

Some work associated with this ticket:
1) perhaps remove a lot of direct api already defined by plugins

If yes then try to take as much code out of the plugin and place in a service.

2) alternatively keep the direct api but define all the context based constructors

Change History

comment:1 Changed 7 years ago by bdezonia

  • Cc curtis added

comment:2 Changed 7 years ago by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

After Curtis made the ContextPlugin class I was able to migrate most of the plugins such that running plugin instances directly is possible. See commit ea9013844149c315897baf211f2519cd6f576c9e

Note: See TracTickets for help on using tickets.