@ Override public void onPluginEvent ( PluginEvent event ) { switch ( event . getAction ( ) ) { case SUBSCRIBE : // Upon initial subscription, begin listening for specified generic events. plugin = event . getPlugin ( ) ; doSubscribe ( true ) ; break ; case LOAD : // Stop listening once loaded. plugin . unregisterListener ( this ) ; break ; case UNSUBSCRIBE : // Stop listening for generic events once unsubscribed from plugin events. doSubscribe ( false ) ; break ; } }
Listen for plugin lifecycle events .