/*## XItemListener ##
349818
public void itemStateChanged(ItemEvent itemEvent) {
        try{

            // retrieve the control that the event has been invoked at...
            XCheckBox xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, itemEvent.Source);
            
            if(xCheckBox != null) {
                // retrieve the control that we want to disable or enable
                XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, m_xDlgContainer.getControl("CommandButton1"));
                XPropertySet xModelPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel());
                short nState = xCheckBox.getState();
                boolean bdoEnable = true;
                switch (nState){
                    case 1:     // checked
                        bdoEnable = true;
                        break;
                    case 0:     // not checked
                    case 2:     // don't know
                        bdoEnable = false;
                        break;
                }
                // Alternatively we could have done it also this way:
                // bdoEnable = (nState == 1);
                xModelPropertySet.setPropertyValue("Enabled", new Boolean(bdoEnable));
            }
            
        }catch (com.sun.star.uno.Exception ex){
            /* perform individual exception handling here.
             * Possible exception types are:
             * com.sun.star.lang.IllegalArgumentException
             * com.sun.star.lang.WrappedTargetException,
             * com.sun.star.beans.UnknownPropertyException,
             * com.sun.star.beans.PropertyVetoException
             * com.sun.star.uno.Exception
             */
            ex.printStackTrace(System.out);
        }
    }
696712
function(inXhr) {
		if (inXhr.onload) {
			inXhr.onload = null;
		}
		if (inXhr.onreadystatechange) {
			inXhr.onreadystatechange = null;
		}
		if (inXhr.abort) {
			inXhr.abort();
		}
	}
59783
function(type, callback) {
        var listeners = this.__getEventListener(type);
        for (var i = 0; i < listeners.length; i++) {
            if (callback === listeners[i]) {
                listeners.splice(i--, 1);
            }
        }
        return this;
    }
52479
function (root) {
        var current = root.prototype ? root.prototype.addEventListener : root.addEventListener;

        var customAddEventListener = function (name, func, capture) {
            // Branch when a PointerXXX is used
            if (supportedEventsNames.indexOf(name) !== -1) {
                setTouchAware(this, name, true);
            }

            if (current === undefined) {
                this.attachEvent('on' + getMouseEquivalentEventName(name), func);
            } else {
                current.call(this, name, func, capture);
            }
        };

        if (root.prototype) {
            root.prototype.addEventListener = customAddEventListener;
        } else {
            root.addEventListener = customAddEventListener;
        }
    }
810113
function EventsBinder() {
    var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    classCallCheck(this, EventsBinder);

    this.listeners = listeners;
  }
301975
function addDelegatedListener(el, type, listener) {
  incrementListenerCount(listener);
  return el.addEventListener(type, getDelegateFunction_(listener));
}
1084523
public void fireSaxStartElement(ContentHandler h, Attributes attrs)
        throws SAXException
    {
        if (h != null) {
            // First; any ns declarations?
            int nsCount = mElementStack.getCurrentNsCount();
            for (int i = 0; i < nsCount; ++i) {
                String prefix = mElementStack.getLocalNsPrefix(i);
                String uri = mElementStack.getLocalNsURI(i);
                h.startPrefixMapping((prefix == null) ? "" : prefix, uri);
            }

            // Then start-elem event itself:
            String uri = mElementStack.getNsURI();
            // Sax requires "" (not null) for ns uris...
            h.startElement((uri == null) ? "" : uri,
                           mElementStack.getLocalName(), getPrefixedName(), attrs);
        }
    }
601478
@Override
  public void fireValueNodeAdded(IValueNode valueNode) {
    for (IDatabaseListener iDatabaseListener : listeners) {
      iDatabaseListener.valueNodeAdded(valueNode);
    }
  }
29887
function addEventListeners(target, types, handler) {
    each(splitStr(types), function(type) {
        target.addEventListener(type, handler, false);
    });
}
319938
void fireExporterEvent(ExporterEvent evt) {
        Object[] listeners = listenerList.getListenerList();
        // Each listener occupies two elements - the first is the listener class
        // and the second is the listener instance
        for (int i = 0; i < listeners.length; i += 2) {
            if (listeners[i] == ExporterEventListener.class) {
                ((ExporterEventListener) listeners[i + 1]).notify(evt);
            }
        }
    }
1341375
function addListenerToEventMap(element, type, listener, useCapture, data) {
        var eventNameLowercase = type.toLowerCase();
        if (!element._eventsMap) {
            element._eventsMap = {};
        }
        if (!element._eventsMap[eventNameLowercase]) {
            element._eventsMap[eventNameLowercase] = [];
        }
        element._eventsMap[eventNameLowercase].push({
            listener: listener,
            useCapture: useCapture,
            data: data
        });
    }
1123026
function(oEvent) {
			var sEventId = oEvent.getParameter("EventId");

			if (sEventId === "messageSelected") {
				if (oEvent.getParameter("type") === "listenerAttached") {
					this._bEnableMessageSelect = true;
				} else if (oEvent.getParameter("type") === "listenerDetached") {
					this._bEnableMessageSelect = false;
				}

				this.fireEvent("_enableMessageSelect", {
					enabled : this._bEnableMessageSelect,
					notifier : this
				});
			}
		}
25945
function() {

		this.Element$informInDOM();

		var input_element = this.getDOMElement();
		Firestorm.Element.addListener(input_element, "onpropertychange", this._OldIE_property_change_callback);
		Firestorm.Element.addListener(input_element, "selectionchange", this._OldIE_refresh_callback);
		Firestorm.Element.addListener(input_element, "keyup", this._OldIE_refresh_callback);
		Firestorm.Element.addListener(input_element, "keydown", this._OldIE_refresh_callback);

	}
345502
function addListener(attr,func,child,update)
        {
          if(typeof func !== 'function') return bind;

          var isInput = (['value','checked'].indexOf(attr) !== -1),
              isStyle = (_allStyles.indexOf(attr) !== -1),
              listeners;

          if(this.toString() !== bind.toString())
          {
            if(child)
            {
              var children = this.querySelectorAll('*'),
                  len = children.length,
                  listenerObj;
              for(var x=0;x<len;x++)
              {
                listenerObj = children[x].attrListeners();
                if(isInput || (attr === _all))
                {
                  if(children[x].addInputBinding !== undefined) children[x].addInputBinding();
                  if(children[x].addInputBoxBinding !== undefined) children[x].addInputBoxBinding();
                }
                if(isStyle)
                {
                  bind.injectStyleProperty(children[x],attr);
                  listeners = (update ? '_parentStyleUpdateListeners' : '_parentStyleListeners');
                  if(listenerObj[listeners][attr] === undefined) listenerObj[listeners][attr] = [];
                  listenerObj[listeners][attr].push({parent:this,func:func});
                }
                else
                {
                  if(attr === _all)
                  {
                    listeners = (update ? '_parentStyleUpdateListeners' : '_parentStyleListeners');
                    var len = _allStyles.length;
                    for(var i = 0;i<len;i++)
                    {
                      bind.injectStyleProperty(children[x],_allStyles[i]);
                    }
                    if(listenerObj[listeners][_all] === undefined) listenerObj[listeners][_all] = [];
                      listenerObj[listeners][_all].push({parent:this,func:func});
                  }
                  listeners = (update ? '_parentAttrUpdateListeners' : '_parentAttrListeners');
                  if(listenerObj[listeners][attr] === undefined) listenerObj[listeners][attr] = [];
                  listenerObj[listeners][attr].push({parent:this,func:func});
                }
              }
            }
            else
            {
              listenerObj = this.attrListeners();
              if(isStyle)
              {
                listeners = (update ? '_styleUpdateListeners' : '_styleListeners');
                bind.injectStyleProperty(this,attr);
                if(listenerObj[listeners][attr] === undefined) listenerObj[listeners][attr] = [];
                listenerObj[listeners][attr].push(func);
              }
              else
              {
                if(isInput || (attr === _all))
                {
                  if(this.addInputBinding !== undefined) this.addInputBinding();
                  if(this.addInputBoxBinding !== undefined) this.addInputBoxBinding();
                }
                if(attr === _all)
                {
                  listeners = (update ? '_styleUpdateListeners' : '_styleListeners');
                  var len = _allStyles.length;
                  for(var x = 0;x<len;x++)
                  {
                    bind.injectStyleProperty(this,_allStyles[x]);
                  }
                  if(listenerObj[listeners][attr] === undefined) listenerObj[listeners][attr] = [];
                  listenerObj[listeners][attr].push(func);
                }
                listeners = (update ? '_attrUpdateListeners' : '_attrListeners');
                if(listenerObj[listeners][attr] === undefined) listenerObj[listeners][attr] = [];
                listenerObj[listeners][attr].push(func);
              }
            }
          }
          else
          {
            if(isInput || (attr === _all))
            {
              var inputs = document.querySelectorAll('input, textarea'),
                  len = inputs.length;
              for(var x=0;x<len;x++)
              {
                if(inputs[x].addInputBinding !== undefined) inputs[x].addInputBinding();
                if(inputs[x].addInputBoxBinding !== undefined) inputs[x].addInputBoxBinding();
              }
            }
            if(isStyle)
            {
              var els = Array.prototype.slice.call(document.body.querySelectorAll('*')),
                  len = (els.length+1);
              els.unshift(document.body);
              for(var x=0;x<len;x++)
              {
                bind.injectStyleProperty(els[x],attr);
              }
              listeners = (update ? _styleUpdateListeners : _styleListeners);
              if(listeners[attr] === undefined) listeners[attr] = [];
              listeners[attr].push(func);
            }
            else
            {
              if(attr === _all)
              {
                var els = Array.prototype.slice.call(document.body.querySelectorAll('*')),
                    len = (els.length+1),
                    lenStyles = _allStyles.length;
                els.unshift(document.body);
                for(var x=0;x<len;x++)
                {
                  for(var i=0;i<lenStyles;i++)
                  {
                    bind.injectStyleProperty(els[x],_allStyles[i]);
                  }
                }
                listeners = (update ? _styleUpdateListeners : _styleListeners);
                if(listeners[attr] === undefined) listeners[attr] = [];
                listeners[attr].push(func);
              }
              listeners = (update ? _attrUpdateListeners : _attrListeners);
              if(listeners[attr] === undefined) listeners[attr] = [];
              listeners[attr].push(func);
            }
          }
        }
1173017
function ( type, fn, context ) {

		var events = this._events = this._events || {},
			contextId = context && context !== this && Util.stamp(context);

		if (contextId) {
			// store listeners with custom context in a separate hash (if it has an id);
			// gives a major performance boost when firing and removing events (e.g. on map object)

			var indexKey = type + '_idx',
				indexLenKey = type + '_len',
				typeIndex = events[indexKey] = events[indexKey] || {},
				id = Util.stamp(fn) + '_' + contextId;

			if (!typeIndex[id]) {
				typeIndex[id] = {fn: fn, ctx: context};

				// keep track of the number of keys in the index to quickly check if it's empty
				events[indexLenKey] = (events[indexLenKey] || 0) + 1;
			}

		} else {
			// individual layers mostly use "this" for context and don't fire listeners too often
			// so simple array makes the memory footprint better while not degrading performance

			events[type] = events[type] || [];
			events[type].push({fn: fn});
		}

		this.fire( 'onlistener', {
			type: type,
			fn: fn,
			context: context
		});
	}
603538
function (lstCfg, itfWrap) {
                for (var evt in lstCfg) {
                    if (lstCfg.hasOwnProperty(evt)) {
                        lstCfg[evt].listenOnce = true;
                    }
                }
                this.$addListeners(lstCfg, itfWrap);
            }
1238797
function() {
			if (!this._boundTriggerListener) {
				this._boundTriggerListener = this._triggerListener.bind(this);
			}
			
			if (this._triggerListenerInstalled) {
				// uninstall the listener if necessary
				if (!this._autoTriggerEnabled || !this._charTriggersInstalled) {
					this.textView.removeEventListener("Modify", this._boundTriggerListener);
					this._triggerListenerInstalled = false;
				}
			} else if (this._autoTriggerEnabled && this._charTriggersInstalled){
				// install the listener if necessary
				this.textView.addEventListener("Modify", this._boundTriggerListener);
				this._triggerListenerInstalled = true;
			}
		}