/*!
 * SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5)
 * (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define(['jquery.sap.global','./Control','sap/ui/model/control/ControlModel'],function(q,C,a){"use strict";var b={};b.mixInto=function(c,f,m){if(arguments.length==2&&typeof f==="object"){m=f;f="ComponentFactory";}function _(){var M=c.getMetadata();do{M=M.getParent();if(M&&M.getComponentFactoryClass){return M.getComponentFactoryClass();}}while(M);return sap.ui.core.ComponentFactory;}c[f]=(_()).subclass(m);c.getMetadata().getComponentFactoryClass=q.sap.getter(c[f]);if(!c.prototype._initCompositeSupport){c.prototype._initCompositeSupport=function(s){var F=new(this.getMetadata().getComponentFactoryClass())(this);if(s.componentFactory){F.customize(s.componentFactory);delete s.componentFactory;}this.getComponentFactory=q.sap.getter(F);};}if(!c.prototype._exitCompositeSupport){c.prototype._exitCompositeSupport=function(){this.getComponentFactory().destroy();delete this.getComponentFactory;};}};sap.ui.base.EventProvider.extend("sap.ui.core.ComponentFactory",{constructor:function(c){sap.ui.base.EventProvider.apply(this);this.oComposite=c;return this;}});sap.ui.core.ComponentFactory.prototype.attachChange=function(f,o){this.getModel();this.attachEvent("change",f,o);return this;};sap.ui.core.ComponentFactory.prototype.detachChange=function(f,o){this.getModel();this.detachEvent("change",f,o);return this;};sap.ui.core.ComponentFactory.prototype.getModel=function(){if(!this.oModel){var t=this;this.oModel=new a(this.oComposite);this.oModel._onchange=function(e){t.fireEvent("change",e.getParameters&&e.getParameters());};}return this.oModel;};sap.ui.core.ComponentFactory.prototype.addFacadeComponent=function(e){this.getModel().add(e);};sap.ui.core.ComponentFactory.prototype.removeFacadeComponent=function(e){this.getModel().remove(e);};(function(){function _(o,m,d){q.each(m,function(n,f){if(n.indexOf("default")!=0){o[n]=f;}if(d&&n.indexOf("create")==0){o["defaultC"+n.substring(1)]=o[n];}});}function c(B){return function(m){var f=function(){B.apply(this,arguments);};f.prototype=q.sap.newObject(B.prototype);_(f.prototype,m,true);f.customize=function(m){_(f.prototype,m);return this;};f.subclass=c(f);return f;};}sap.ui.core.ComponentFactory.subclass=c(sap.ui.core.ComponentFactory);sap.ui.core.ComponentFactory.prototype.customize=function(m){_(this,m);if(this.oComposite&&this.oComposite._onComponentFactoryChanged){this.oComposite._onComponentFactoryChanged();}return this;};}());return b;},true);
