
registerType('info.appdoo-mac', (function () { function KeyValueStore() {} var __super = setSupertypeFromDomain(KeyValueStore, 'BasicDataSource', 'appdoo');

	Object.defineProperty(KeyValueStore.prototype, "localData", {
	outlet: true, 
	enumerable: true, get:function () { return this._localData; }, set:function (v) {if (!Object.hasOwnProperty(this, "_localData")) Object.defineProperty(this, "_localData", { writable: true, configurable: true }); this._localData = v; }});
	

	Object.defineProperty(KeyValueStore.prototype, "contents", {
	outlet: true, 
		get: function () { return this.localData; }, 
		set: function (v) {if (!Object.hasOwnProperty(this, "_contents")) Object.defineProperty(this, "_contents", { writable: true, configurable: true }); this.localData = v; }});
	

KeyValueStore.prototype.createForContext = function KeyValueStore_createForContext(context) {
		var inst = __super.prototype.createForContext.call(this, context);
		inst.localData = {};
		inst.location = 'local';
		return inst;};
	

	Object.defineProperty(KeyValueStore.prototype, "readableType", {
		get: function () { return LocalizedString("Key/Value-Store"); }});
	
	
	Object.defineProperty(KeyValueStore.prototype, "inspectorProperties", {
		get: function () {
			
			return [
				{
					type: 'group',
					title: this.readableType,
					id: this.constructor.name,
					items: [
						
						
						
						
						
						{ name: '', keyPath: 'localData', type: 'keyValue', height: 320-5, columns: [
									  { name: "key", title: LocalizedString("Name"), width: 0.55, "fontSize": 11, editable: true },
									  { name: "value", title: LocalizedString("Value"), width: 0.45, "fontSize": 11, editable: true }
									]
								}

						
					]
				},














			];
		}});
	
	




	






	Object.defineProperty(KeyValueStore.prototype, "providesRootData", {
		value: true});
	

	Object.defineProperty(KeyValueStore.prototype, "rootDataKeyPath", {
		value: 'contents'});
	
	
	Object.defineProperty(KeyValueStore.prototype, "bindableProperties", {
		value: null});
	

	Object.defineProperty(KeyValueStore.prototype, "mutable", {
		value: true});
	
	





















	Object.defineProperty(KeyValueStore.prototype, "performableActions", {
		get: function () {
			return {
				'saveInDatabase:<#database#>': { name: LocalizedString('save in database'), parameters: [{ type:'object', name:LocalizedString('Datenbank'), key:'database', objectType:'info.appdoo-mac.SimpleDatabase', canChooseNothing:true }] },
				'deleteFromDatabase:<#database#>': { name: LocalizedString('delete from database'), parameters: [{ type:'object', name:LocalizedString('Datenbank'), key:'database', objectType:'info.appdoo-mac.SimpleDatabase', canChooseNothing:true }] },
				'replaceWithContentsFromDataSource:<#dataSource#>': { name: LocalizedString('fetch contents from source'), parameters: [{ type:'object', objectType:'dataSource', includeDynamicContext:true, name:LocalizedString('Source'), key:'dataSource', canChooseNothing:true }] }
			};
		}});
	
	
KeyValueStore.prototype.simulateAction = function KeyValueStore_simulateAction(actionID) {
		if (actionID === 'send') {
			var json = JSON.stringify(this.contents);
			alert(json);
		}};
	

	Object.defineProperty(KeyValueStore.prototype, "shouldNotPreviewInEditor", {
		value: true});
	
	
KeyValueStore.prototype.setValueForKeyPath = function KeyValueStore_setValueForKeyPath(value, keyPath, sender) {
		
		__super.prototype.setValueForKeyPath.call(this, value, keyPath, sender);
		if (keyPath && keyPath.indexOf('contents.') === 0) {
			this.notifyObservers();
		}};
	

KeyValueStore.prototype.initPropertiesFromData = function KeyValueStore_initPropertiesFromData(data) {
try { __super.prototype.initPropertiesFromData.call(this, data); } catch (err) {}
if (data.hasOwnProperty("localData")) this.localData = data.localData;
if (data.hasOwnProperty("contents")) this.contents = data.contents;
};

KeyValueStore.prototype.decodeData = function KeyValueStore_decodeData(data) { var decoded;
try { decoded = __super.prototype.decodeData.call(this, data); } catch (err) { console.warn(err); decoded = clone(data); }
return decoded; };

KeyValueStore.prototype.encode = function KeyValueStore_encode() { var encoded;
try { encoded = __super.prototype.encode.call(this); } catch (err) { console.warn(err); encoded = this.context.encodeObject(this); }
return encoded; };

KeyValueStore.prototype.encodeCloned = function KeyValueStore_encodeCloned() { var encoded;
try { encoded = __super.prototype.encodeCloned.call(this); } catch (err) { console.warn(err); encoded = {}; }
return encoded; };

KeyValueStore.prototype.expectedTypeForProperty = function KeyValueStore_expectedTypeForProperty(key) {
	if (key === "localData") return "Object";
	if (key === "contents") return "Object";
	if (key === "readableType") return "";
	if (key === "inspectorProperties") return "";
	if (key === "providesRootData") return "";
	if (key === "rootDataKeyPath") return "";
	if (key === "bindableProperties") return "";
	if (key === "mutable") return "";
	if (key === "performableActions") return "";
	if (key === "shouldNotPreviewInEditor") return "";
	if (__super) return __super.prototype.expectedTypeForProperty(key);
};

return KeyValueStore; }()));