'use strict';
var MessageServiceStub = require('caplin/services/testing/MessageServiceStub');
var PresenterComponent = require('caplin/presenter/component/PresenterComponent');
var TilePresentationModel = require('mycompany/tutorial/tile/TilePresentationModel');

function TileWorkbenchApplication() {
	this._templateID = 'mycompany.tutorial.tile.tile-template';
	this._createPresenterComponents();
}

TileWorkbenchApplication.prototype._createPresenterComponents = function() {
	this._presentationModel = new TilePresentationModel();
	this._presenterComponent = new PresenterComponent(this._templateID, this._presentationModel);
	this._presenterComponent.setFrame(null);
};

TileWorkbenchApplication.prototype.getElement = function() {
	return this._presenterComponent.getElement();
};

TileWorkbenchApplication.prototype.getPresentationModel = function() {
	return this._presentationModel;
};

TileWorkbenchApplication.prototype.getDataSubscriber = function(sSubject) {
	//Get subscriber from MessageServiceStub (to be used by price generator in workbench)
	return MessageServiceStub.mDataSubscribers[sSubject][0];
};

module.exports = TileWorkbenchApplication;
