Annotation Type Plugin

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends SciJavaPlugin> type
      The type of plugin; e.g., Service.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      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.
      • CONTEXT_MENU_ROOT

        @Deprecated
        static final String CONTEXT_MENU_ROOT
        Deprecated.
        Use a context-specific menu root string instead. This one is too general. There is no such thing as a "default context menu" since such a thing wouldn't be a context menu!
      • name

        String name
        The name of the plugin.
        Default:
        ""
      • label

        String label
        The human-readable label to use (e.g., in the menu structure).
        Default:
        ""
      • description

        String description
        A longer description of the plugin (e.g., for use as a tool tip).
        Default:
        ""
      • menuPath

        String menuPath
        Abbreviated menu path defining where the plugin is shown in the menu structure. Uses greater than signs (>) as a separator; e.g.: "Image > Overlay > Properties..." defines a "Properties..." menu item within the "Overlay" submenu of the "Image" menu. Use either menuPath() or menu() but not both.
        Default:
        ""
      • menu

        Menu[] menu
        Full menu path defining where the plugin is shown in the menu structure. This construction allows menus to be fully specified including mnemonics, accelerators and icons. Use either menuPath() or menu() but not both.
        Default:
        {}
      • menuRoot

        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. The default value of UIDetails.APPLICATION_MENU_ROOT references the menu structure of the primary application window.
        Default:
        "app"
      • iconPath

        String iconPath
        Path to the plugin's icon (e.g., shown in the menu structure).
        Default:
        ""
      • selectable

        boolean selectable
        Whether the plugin can be selected in the user interface. A plugin's selection state (if any) is typically rendered in the menu structure using a checkbox or radio button menu item (see selectionGroup()).
        Default:
        false
      • selectionGroup

        String selectionGroup
        For selectable plugins, specifies a name defining a group of linked plugins, only one of which is selected at any given time. Typically this is rendered in the menu structure as a group of radio button menu items. If no group is given, the plugin is assumed to be a standalone toggle, and typically rendered as a checkbox menu item.
        Default:
        ""
      • enabled

        boolean enabled
        When false, the plugin is grayed out in the user interface, if applicable.
        Default:
        true
      • visible

        boolean visible
        When false, the plugin is not displayed in the user interface.
        Default:
        true
      • headless

        boolean headless
        Provides a "hint" as to whether the plugin would behave correctly in a headless context.

        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.

        Default:
        false
      • initializer

        String initializer
        Defines a function that is called to initialize the plugin in some way.
        Default:
        ""
      • attrs

        Attr[] attrs
        A list of additional attributes which can be used to extend this annotation beyond its built-in capabilities.

        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.

        Default:
        {}