
registerType('appdoo', (function () { function ProjectMetadataController() {} var __super = setSupertypeFromDomain(ProjectMetadataController, 'ObjectController', 'Core');

ProjectMetadataController.prototype.setValueForKeyPath = function ProjectMetadataController_setValueForKeyPath(value, keyPath, sender) {
		
		if (value && value.UTI === 'appdoo.ImageReference') {
			this.context.projectContext.unregisterImageWithID(this.get(keyPath+'.imageID'));
			this.context.projectContext.registerImageWithID(value.imageID);
		}
		
		
		if (value && value.UTI) {
			value = value.encode();
		}
		
		if (keyPath === 'title')
			value = this.compliantAppTitle(value);
		
		__super.prototype.setValueForKeyPath.call(this, value, keyPath, sender);
		
		};
	
	
ProjectMetadataController.prototype.get = function ProjectMetadataController_get(keyPath) {
		var value = __super.prototype.get.call(this, keyPath);
		if (value && value.$type) return this.context.projectContext.decodeObjectTree(value);
		return value;};
	
	
ProjectMetadataController.prototype.compliantAppTitle = function ProjectMetadataController__compliantAppTitle(title) {
		
		if (!title) return LocalizedString('Untitled');
		
		
		title = title.replace(/(^\s+|\s+$)/g, '');
		return title;
		};
	
	
ProjectMetadataController.prototype.expectedTypeForProperty = function ProjectMetadataController_expectedTypeForProperty(key) {
	if (__super) return __super.prototype.expectedTypeForProperty(key);
};

return ProjectMetadataController; }()));