// ----------------------------------
// File
// ----------------------------------
var fileTypeEnum = new Enumeration('Standard Input', 'Standard Output', 'Standard Error', 'Function IO', 'Command Arguments', 'Normal', 'Standard IO', 'Class Prototype', 'Class IO');
var File = Class.create(DeferredModel, {
  initialize: function($super) {
    $super(['id', 'label', 'filename', 'content', 'type', 'common', 'whitespace_friendliness', 'punctuation_friendliness', 'case_friendliness', 'sorted_friendliness', 'sortuniq_friendliness', 'floats_friendliness'], 'file', fileStore);
  }
});

var fileStore = new ModelStore('file', File);


// ----------------------------------
// File UI
// ----------------------------------
displayEnumerationInSelectInput(fileTypeEnum, 'edit_file_type');
new ValueObserver('edit_file_label', fileStore.proxy, 'label');
new ValueObserver('edit_file_filename', fileStore.proxy, 'filename');
new ValueObserver('edit_file_type', fileStore.proxy, 'type');
new CheckedObserver('edit_file_common', fileStore.proxy,'common');
new CheckedObserver('edit_file_whitespace_friendliness', fileStore.proxy,'whitespace_friendliness');
new CheckedObserver('edit_file_punctuation_friendliness', fileStore.proxy,'punctuation_friendliness');
new CheckedObserver('edit_file_case_friendliness', fileStore.proxy,'case_friendliness');
new CheckedObserver('edit_file_sorted_friendliness', fileStore.proxy,'sorted_friendliness');
new CheckedObserver('edit_file_sortuniq_friendliness', fileStore.proxy,'sortuniq_friendliness');
new ValueObserver('edit_file_floats_friendliness', fileStore.proxy, 'floats_friendliness');
new ValueObserver('edit_file_content', fileStore.proxy, 'content');
new SelectableProxyStoreObserver('test_files', fileStore, 'id', 'label');
new SaveAction('save_edit_file', fileStore, 'click');
new DestroyAction('delete_edit_file', fileStore, 'click');
new NewAction('new_file', fileStore, 'click');
