net/sf/jsm/+jsmObject.js
Summary
No overview generated for 'net/sf/jsm/+jsmObject.js'
Class Summary
|
JsmObject |
Root of all other jsm classes. |
function JsmObject() {
logger.error("JsmObject is abstract and can not be instantiated");
throw new Error("JsmObject is an abstract class and can not be instatiated");
}
JsmObject.prototype.className="JsmObject";
JsmObject.prototype.id=null;
JsmObject.prototype.META_DATA_NAME_PROPERTY_PATH = "propertyPath";
JsmObject.prototype.META_DATA_NAME_VALUE = "value";
JsmObject.prototype._attributes=null;
JsmObject.prototype._metaData=null;
JsmObject.prototype.toString = function() {
return "[" + this.className + " object]"
}
JsmObject.prototype.identify = function() {
return "[" + this.className + ":" + this.getId() + "]"
}
JsmObject.prototype.setId = function(theId) {
logger.debug(this.identify() + " Set id to: " + theId);
this.id = theId;
return this;
}
JsmObject.prototype.getId = function() {
return this.id;
}
JsmObject.prototype.setAttribute = function(name, value) {
logger.debug(this.identify() + " Set attribute: " + name + " - " + value);
if (!this._attributes) {this._attributes = new Array();}
if (name == 'colspan') {name = 'colSpan'};
if (name == 'class') {name = 'className'};
this._attributes[name]=value;
return this;
}
JsmObject.prototype.getAttribute = function(name) {
if (!this._attributes) {this._attributes = new Array();}
if (jsm.noud(name)) {return this._attributes;}
if (name == 'colspan') {name = 'colSpan'};
if (name == 'class') {name = 'className'};
return this._attributes[name];
}
JsmObject.prototype.setMetaData = function(name, value) {
if (!this._metaData) {this._metaData = new Array();}
this._metaData[name]=value;
return this;
}
JsmObject.prototype.getMetaData = function(name) {
if (!this._metaData) {this._metaData = new Array();}
if (jsm.noud(name)) {return this._metaData;}
return this._metaData[name];
}
JsmObject.prototype.addAttributesToViewComponent = function (theViewComponent) {
for (var attributeName in this._attributes) {
if (typeof this._attributes[attributeName] == 'function') {continue;}
if (attributeName == 'onkeyup') {theViewComponent.onkeyup=_jsmOnKeyUpEventDelegate;continue;}
if (attributeName == 'onchange') {theViewComponent.onchange=_jsmOnChangeEventDelegate;continue;}
if (attributeName == 'onclick') {theViewComponent.onclick=_jsmOnClickEventDelegate;continue;}
if (attributeName == 'onmousedown') {theViewComponent.onmousedown=_jsmOnMouseDownEventDelegate;continue;}
if (attributeName == 'onmouseup') {theViewComponent.onmouseup=_jsmOnMouseUpEventDelegate;continue;}
if (attributeName == 'onmousemove') {theViewComponent.onmousemove=_jsmOnMouseMoveEventDelegate;continue;}
theViewComponent.setAttribute(attributeName, this._attributes[attributeName])
}
}
Documentation generated by
JSDoc on Tue Sep 26 08:42:57 2006