2016-10-16 14:16:08 +00:00
|
|
|
|
|
|
|
var Widget = require ('./widget');
|
|
|
|
|
|
|
|
module.exports = new Class
|
|
|
|
({
|
|
|
|
Extends: Widget
|
|
|
|
|
|
|
|
,builder: null
|
|
|
|
|
|
|
|
,builderInit: function (path)
|
|
|
|
{
|
|
|
|
var builder = new Vn.Builder ();
|
|
|
|
builder.signalData = this;
|
|
|
|
builder.loadXml (path, this.doc);
|
|
|
|
this.builderResultInit (builder);
|
|
|
|
}
|
|
|
|
|
|
|
|
,builderInitString: function (xmlString)
|
|
|
|
{
|
|
|
|
var builder = new Vn.Builder ();
|
|
|
|
builder.signalData = this;
|
|
|
|
builder.loadFromString (xmlString, this.doc);
|
|
|
|
this.builderResultInit (builder);
|
|
|
|
}
|
|
|
|
|
|
|
|
,builderResultInit: function (builder)
|
|
|
|
{
|
|
|
|
var res = this.builder = builder.load ();
|
|
|
|
this._node = res.$('main');
|
|
|
|
res.link ();
|
2017-03-23 16:20:51 +00:00
|
|
|
return res;
|
2016-10-16 14:16:08 +00:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:20:51 +00:00
|
|
|
/**
|
|
|
|
* Gets an object from the builder associated to this component.
|
|
|
|
*
|
|
|
|
* @param {string} objectId The object identifier
|
|
|
|
* @return {Object} The object, or %null if not found
|
|
|
|
*/
|
2016-10-16 14:16:08 +00:00
|
|
|
,$: function (id)
|
|
|
|
{
|
|
|
|
if (this.builder)
|
|
|
|
return this.builder.getById (id);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
,_destroy: function ()
|
|
|
|
{
|
|
|
|
if (this.builder)
|
|
|
|
this.builder.unref ();
|
|
|
|
|
|
|
|
this.parent ();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|