"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BoardsListWidget = void 0;
var inversify_1 = require("inversify");
var boards_service_1 = require("../../common/protocol/boards-service");
var list_widget_1 = require("../widgets/component-list/list-widget");
var list_item_renderer_1 = require("../widgets/component-list/list-item-renderer");
var BoardsListWidget = /** @class */ (function (_super) {
    __extends(BoardsListWidget, _super);
    function BoardsListWidget(service, itemRenderer) {
        var _this = _super.call(this, {
            id: BoardsListWidget_1.WIDGET_ID,
            label: BoardsListWidget_1.WIDGET_LABEL,
            iconClass: 'fa fa-microchip',
            searchable: service,
            installable: service,
            itemLabel: function (item) { return item.name; },
            itemRenderer: itemRenderer
        }) || this;
        _this.service = service;
        _this.itemRenderer = itemRenderer;
        return _this;
    }
    BoardsListWidget_1 = BoardsListWidget;
    BoardsListWidget.prototype.init = function () {
        var _this = this;
        _super.prototype.init.call(this);
        this.toDispose.pushAll([
            this.notificationCenter.onPlatformInstalled(function () { return _this.refresh(undefined); }),
            this.notificationCenter.onPlatformUninstalled(function () { return _this.refresh(undefined); }),
        ]);
    };
    var BoardsListWidget_1;
    BoardsListWidget.WIDGET_ID = 'boards-list-widget';
    BoardsListWidget.WIDGET_LABEL = 'Boards Manager';
    __decorate([
        inversify_1.postConstruct(),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", []),
        __metadata("design:returntype", void 0)
    ], BoardsListWidget.prototype, "init", null);
    BoardsListWidget = BoardsListWidget_1 = __decorate([
        inversify_1.injectable(),
        __param(0, inversify_1.inject(boards_service_1.BoardsService)),
        __param(1, inversify_1.inject(list_item_renderer_1.ListItemRenderer)),
        __metadata("design:paramtypes", [Object, list_item_renderer_1.ListItemRenderer])
    ], BoardsListWidget);
    return BoardsListWidget;
}(list_widget_1.ListWidget));
exports.BoardsListWidget = BoardsListWidget;
//# sourceMappingURL=boards-list-widget.js.map