|Constructor and Description|
|Modifier and Type||Method and Description|
This ungainly convenience method adds a WikiEventListener to the appropriate component of the provided client Object, to listen for events of the provided type (or related types, see the table below).
public static void addWikiEventListener(Object client, int type, WikiEventListener listener)
If the type value is valid but does not match any WikiEvent type known to this method, this will just attach the listener to the client Object. This may mean that the Object never fires events of the desired type; type-to-client matching is left to you to guarantee. Silence is golden, but not if you want those events.
Most event types expect a WikiEngine as the client, with the rest attaching the listener directly to the supplied source object, as described below:
|WikiEvent Type(s)||Required Source Object||Actually Attached To|
|WikiPageEvent.PAGE_LOCK, WikiPageEvent.PAGE_UNLOCK||WikiEngine or PageManager||PageManager|
|WikiPageEvent (phase boundary event)||WikiEngine||FilterManager|
|WikiPageEvent (in-phase event)|
|WikiPageEvent (in-phase event)||any||source object|
|any other valid type||any||source object|
|any invalid type||any||nothing|
phase boundary event types: WikiPageEvent.PRE_TRANSLATE_BEGIN, WikiPageEvent.PRE_TRANSLATE_END, WikiPageEvent.POST_TRANSLATE_BEGIN, WikiPageEvent.POST_TRANSLATE_END, WikiPageEvent.PRE_SAVE_BEGIN, WikiPageEvent.PRE_SAVE_END, WikiPageEvent.POST_SAVE_BEGIN, and WikiPageEvent.POST_SAVE_END.
in-phase event types: WikiPageEvent.PRE_TRANSLATE, WikiPageEvent.POST_TRANSLATE, WikiPageEvent.PRE_SAVE, and WikiPageEvent.POST_SAVE.
Note: The Actually Attached To column may also be considered as the class(es) that fire events of the type(s) shown in the WikiEvent Type column.
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.