
function FileFormatPickerController(filterModel) {
	this.fileFormatPickerModel = new FileFormatPickerModel();
	this.fileFormatPickerView = new FileFormatPickerView();
	this.filterModel = filterModel;
	TSWIDGET.EVENTS.subscribeEx('evtShowFileFormatPicker', this.show, this, true);	
	TSWIDGET.EVENTS.subscribeEx('evtFileFormatPickerApply', this.fileFormatPickerApply, this, true);
	TSWIDGET.EVENTS.subscribeEx('evtFilterFileFormat', this.filterFileFormat, this, true);
	this.init();
} 

FileFormatPickerController.prototype.init = function(){
	this.fileFormatPickerView.init();
}

FileFormatPickerController.prototype.show = function(){
	this.fileFormatPickerView.show();
	this.fileFormatPickerModel.feachFileFormat();
}
FileFormatPickerController.prototype.filterFileFormat = function(key){
	this.fileFormatPickerModel.filterFileFormat(key);
}
FileFormatPickerController.prototype.fileFormatPickerApply = function(values){
	TSWIDGET.EVENTS.fireEvent('evtClickFilterItemLink', "Compatibility");
	var argFormats = ["file_type", values, true];
	TSWIDGET.EVENTS.fireEvent('evtUpdateFilter',argFormats);
	this.fileFormatPickerView.close();
}
