|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Plugin
Annotation identifying a plugin, which gets loaded by SciJava's dynamic discovery mechanism.
SciJavaPlugin
,
PluginService
Required Element Summary | |
---|---|
Class<? extends SciJavaPlugin> |
type
The type of plugin; e.g., Service . |
Optional Element Summary | |
---|---|
Attr[] |
attrs
A list of additional attributes which can be used to extend this annotation beyond its built-in capabilities. |
String |
description
A longer description of the plugin (e.g., for use as a tool tip). |
boolean |
enabled
When false, the plugin is grayed out in the user interface, if applicable. |
boolean |
headless
Provides a "hint" as to whether the plugin would behave correctly in a headless context. |
String |
iconPath
Path to the plugin's icon (e.g., shown in the menu structure). |
String |
initializer
Defines a function that is called to initialize the plugin in some way. |
String |
label
The human-readable label to use (e.g., in the menu structure). |
Menu[] |
menu
Full menu path defining where the plugin is shown in the menu structure. |
String |
menuPath
Abbreviated menu path defining where the plugin is shown in the menu structure. |
String |
menuRoot
String identifier naming the menu to which this plugin belongs, or in the case of a tool, the context menu that should be displayed while the tool is active. |
String |
name
The name of the plugin. |
double |
priority
The plugin index returns plugins sorted by priority. |
boolean |
selectable
Whether the plugin can be selected in the user interface. |
String |
selectionGroup
For selectable plugins, specifies a name defining a group of linked plugins, only one of which is selected at any given time. |
boolean |
visible
When false, the plugin is not displayed in the user interface. |
Element Detail |
---|
public abstract Class<? extends SciJavaPlugin> type
Service
.
public abstract String name
public abstract String label
public abstract String description
public abstract String menuPath
menuPath()
or menu()
but not both.
public abstract Menu[] menu
menuPath()
or menu()
but
not both.
public abstract String menuRoot
UIDetails.APPLICATION_MENU_ROOT
references the menu structure of the primary application window.
public abstract String iconPath
public abstract double priority
Service
s to control which service
implementation is chosen when multiple implementations are present in the
classpath, as well as to force instantiation of one service over another
when the dependency hierarchy does not dictate otherwise.
Any double value is allowed, but for convenience, there are some presets:
Priority.FIRST_PRIORITY
Priority.VERY_HIGH_PRIORITY
Priority.HIGH_PRIORITY
Priority.NORMAL_PRIORITY
Priority.LOW_PRIORITY
Priority.VERY_LOW_PRIORITY
Priority.LAST_PRIORITY
Service
public abstract boolean selectable
selectionGroup()
).
public abstract String selectionGroup
public abstract boolean enabled
public abstract boolean visible
public abstract boolean headless
Plugin developers should not specify headless = true
unless the
plugin refrains from using any UI-specific features (e.g., AWT or Swing
calls).
Of course, merely setting this flag does not guarantee that the plugin will not invoke any headless-incompatible functionality, but it provides an extra safety net for downstream headless code that wishes to be conservative in which plugins it allows to execute.
public abstract String initializer
public abstract Attr[] attrs
Note to developers: when designing new plugin types, it is tempting to use this attribute to store additional information about each plugin. However, we suggest doing so only if you need that additional information before creating an instance of the plugin: e.g., to decide whether to instantiate one, or even whether to load the annotated plugin class at all. If you are going to create a plugin instance anyway, it is cleaner and more type-safe to add proper API methods to the plugin type's interface reporting the same information.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |