define('application/formatters/label', [
'antie/iterator',
'antie/runtimecontext',
'antie/formatter',
'rofl/widgets/label',
'rofl/widgets/button'
], function (
Iterator,
RuntimeContext,
Formatter,
Label,
Button
) {
'use strict';
return Formatter.extend({
/**
* Formats the widget.
*
* @param {Object|Iterator} item - The item.
* @returns {Object} - The formatted widget.
*/
format: function (item) {
var button,
label;
if (item instanceof Iterator) {
item = item.next();
}
label = new Label('', item.text, true);
button = new Button();
button.appendChildWidget(label);
return button;
}
});
});