/*!
 * 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','./library','sap/ui/core/Control'],function(q,l,C){"use strict";var O=C.extend("sap.m.ObjectAttribute",{metadata:{library:"sap.m",properties:{title:{type:"string",group:"Misc",defaultValue:null},text:{type:"string",group:"Misc",defaultValue:null},active:{type:"boolean",group:"Misc",defaultValue:null},textDirection:{type:"sap.ui.core.TextDirection",group:"Appearance",defaultValue:sap.ui.core.TextDirection.Inherit}},aggregations:{_textControl:{type:"sap.ui.core.Control",multiple:false,visibility:"hidden"}},events:{press:{parameters:{domRef:{type:"string"}}}}}});O.prototype.init=function(){this.setAggregation('_textControl',new sap.m.Text());};O.prototype._getUpdatedTextControl=function(){var t=this.getAggregation('_textControl');var T=this.getTextDirection();var p=this.getParent();var P=sap.ui.getCore().getConfiguration().getRTL();var m={singleLine:1,multiLine:2};var M=m.multiLine;var o='';if(T===sap.ui.core.TextDirection.LTR&&P){o='\u200e';}if(T===sap.ui.core.TextDirection.RTL&&!P){o='\u200f';}t.setProperty('text',(this.getTitle()?this.getTitle()+": ":"")+o+this.getText()+o,true);if(p&&((p instanceof sap.m.ObjectHeader&&p.getResponsive())||p instanceof sap.m.ObjectListItem)){M=m.singleLine;}t.setProperty('maxLines',M,true);return t;};O.prototype.ontap=function(e){if(!!this.getActive()&&(e.target.id!=this.getId())){this.firePress({domRef:this.getDomRef()});}};sap.m.ObjectAttribute.prototype.onsapenter=function(e){if(!!this.getActive()){this.firePress({domRef:this.getDomRef()});}};sap.m.ObjectAttribute.prototype.onsapspace=function(e){this.onsapenter(e);};O.prototype._isEmpty=function(){return!(this.getText().trim()||this.getTitle().trim());};O.prototype.ontouchstart=function(e){if(!!this.getActive()){e.originalEvent._sapui_handledByControl=true;}};return O;},true);
