Home Reference Source Repository
import PluginManagement from 'minimap/lib/mixins/plugin-management.js'
public class | source

PluginManagement

Extends:

mixto~Mixin → PluginManagement

Provides methods to manage minimap plugins. Minimap plugins are Atom packages that will augment the minimap. They have a secondary activation cycle going on constrained by the minimap package activation. A minimap plugin life cycle will generally look like this:

  1. The plugin module is activated by Atom through the activate method
  2. The plugin then register itself as a minimap plugin using registerPlugin
  3. The plugin is activated/deactivated according to the minimap settings.
  4. On the plugin module deactivation, the plugin must unregisters itself from the minimap using the unregisterPlugin.

Method Summary

Public Methods
public

Deactivates all the plugins registered in the minimap package so far.

public

* eachPlugin(): *

A generator function to iterate over registered plugins.

public

Returns the Minimap main module instance.

public

registerPlugin(name: string, plugin: MinimapPlugin)

Registers a minimap plugin with the given name.

public

Toggles the specified plugin activation state.

public

Unregisters a plugin from the minimap.

Public Methods

public deactivateAllPlugins() source

Deactivates all the plugins registered in the minimap package so far.

Emit:

did-deactivate-plugin

for each plugin deactivated by the call.

public * eachPlugin(): * source

A generator function to iterate over registered plugins.

Return:

*

An iterable that yield the name and reference to every plugin as an array in each iteration.

public provideMinimapServiceV1(): Main source

Returns the Minimap main module instance.

Return:

Main

The Minimap main module instance.

public registerPlugin(name: string, plugin: MinimapPlugin) source

Registers a minimap plugin with the given name.

Params:

NameTypeAttributeDescription
name string

The identifying name of the plugin. It will be used as activation settings name as well as the key to unregister the module.

plugin MinimapPlugin

The plugin to register.

Emit:

did-add-plugin

with the name and a reference to the added plugin.

did-activate-plugin

if the plugin was activated during the registration.

public togglePluginActivation(name: string, boolean: boolean) source

Toggles the specified plugin activation state.

Params:

NameTypeAttributeDescription
name string

The name of the plugin.

boolean boolean

An optional boolean to set the activation state of the plugin. If ommitted the new plugin state will be the the inverse of its current state.

Emit:

did-activate-plugin

if the plugin was activated by the call.

did-deactivate-plugin

if the plugin was deactivated by the call.

public unregisterPlugin(name: string) source

Unregisters a plugin from the minimap.

Params:

NameTypeAttributeDescription
name string

The identifying name of the plugin to unregister.

Emit:

did-remove-plugin

with the name and a reference to the added plugin.