AjxEventMgr.js
Summary
No overview generated for 'AjxEventMgr.js'
function AjxEventMgr() {
this._listeners = new Object();
}
AjxEventMgr.prototype.toString =
function() {
return "AjxEventMgr";
}
AjxEventMgr.prototype.addListener =
function(eventType, listener) {
var lv = this._listeners[eventType];
if (lv == null) {
lv = this._listeners[eventType] = new AjxVector();
}
if (!lv.contains(listener)) {
if (this._notifyingListeners) {
lv = this._listeners[eventType] = lv.clone();
}
lv.add(listener);
return true;
}
return false;
}
AjxEventMgr.prototype.notifyListeners =
function(eventType, event) {
this._notifyingListeners = true;
var lv = this._listeners[eventType];
if (lv != null) {
var a = lv.getArray();
var s = lv.size();
var retVal = null;
var c = null;
for (var i = 0; i < s; i++) {
c = a[i];
retVal = c.handleEvent ? c.handleEvent(event) : c(event);
if (retVal === false) {
break;
}
}
}
this._notifyingListeners = false;
}
AjxEventMgr.prototype.isListenerRegistered =
function(eventType) {
var lv = this._listeners[eventType];
return (lv != null && lv.size() > 0);
}
AjxEventMgr.prototype.removeListener =
function(eventType, listener) {
var lv = this._listeners[eventType];
if (lv != null) {
if (this._notifyingListeners) {
lv = this._listeners[eventType] = lv.clone();
}
lv.remove(listener);
return true;
}
return false;
}
AjxEventMgr.prototype.removeAll =
function(eventType) {
var lv = this._listeners[eventType];
if (lv != null) {
if (this._notifyingListeners) {
lv = this._listeners[eventType] = lv.clone();
}
lv.removeAll();
return true;
}
return false;
}
Documentation generated by
JSDoc on Thu Apr 27 13:58:40 2006