*/
private void enableListening(IHook ih, boolean listen) {
if (ih == null) {
return;
}
HookModel hm = (HookModel) ih;
if (listen) {
hm.addListener(listenerHook);
}
else {
hm.removeListener(listenerHook);
}
if (ih.getCommandsList() != null) {
for (IHookCommand ihc : ih.getCommandsList()) {
enableListening(ihc, listen);
}