/*!
 * 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','./Element','./library','./theming/Parameters'],function(q,E,l,P){"use strict";var M=E.extend("sap.ui.core.Message",{metadata:{library:"sap.ui.core",properties:{text:{type:"string",group:"Misc",defaultValue:null},timestamp:{type:"string",group:"Misc",defaultValue:null},icon:{type:"sap.ui.core.URI",group:"Misc",defaultValue:null},level:{type:"sap.ui.core.MessageType",group:"Misc",defaultValue:sap.ui.core.MessageType.None},readOnly:{type:"boolean",group:"Misc",defaultValue:false}}}});M.prototype.getDefaultIcon=function(s){var m=q.sap.getModulePath("sap.ui.core",'/');var t="themes/"+sap.ui.getCore().getConfiguration().getTheme();var i="/img/message/";if(s&&s=="32x32"){i+="32x32/";}else{i+="16x16/";}var u="";switch(this.getProperty("level")){case sap.ui.core.MessageType.Error:u=m+t+i+"Message_Icon_Error.png";break;case sap.ui.core.MessageType.Information:u=m+t+i+"Message_Icon_Information.png";break;case sap.ui.core.MessageType.Warning:u=m+t+i+"Message_Icon_Warning.png";break;case sap.ui.core.MessageType.Success:u=m+t+i+"Message_Icon_Success.png";break;case sap.ui.core.MessageType.None:default:u=this.getProperty("icon");break;}return u;};M.prototype.compareByType=function(o){M.compareByType(this,o);};M.compareByType=function(m,o){if(!m&&!o){return 0;}if(m&&!o){return 1;}if(!m&&o){return-1;}var L=m.getLevel();var s=o.getLevel();var t=sap.ui.core.MessageType;if(L===s){return 0;}switch(L){case t.Error:return 1;case t.Warning:return s===t.Error?-1:1;case t.Success:return s===t.Error||s===t.Warning?-1:1;case t.Information:return s===t.None?1:-1;case t.None:return-1;default:q.sap.log.error("Comparison error",this);return 0;}};return M;},true);
