/**
 * Generated by Apache Royale Compiler from org\apache\royale\jewel\supportClasses\util\getLabelFromData.as
 * org.apache.royale.jewel.supportClasses.util.getLabelFromData
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.jewel.supportClasses.util.getLabelFromData');
goog.require('org.apache.royale.utils.Language');



/**
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * 
 *  Utility function to get a label string from a value object
 * @export
 * @param {Object} obj
 * @param {Object} data
 * @return {string}
 */
org.apache.royale.jewel.supportClasses.util.getLabelFromData = function(obj, data) {
  if (!data)
    return "";
  if (!org.apache.royale.utils.Language.is(data, String)) {
    if (obj["labelField"])
      return String(data[obj["labelField"]]);
    if (obj["dataField"])
      return String(data[obj["dataField"]]);
    if (data.hasOwnProperty("label"))
      return String(data["label"]);
  }
  return String(data);
}