src/sap.ui.core/src/sap/ui/core/LabelEnablement.js
function checkLabelEnablementPreconditions(oControl) {
		if (!oControl) {
			throw new Error("sap.ui.core.LabelEnablement cannot enrich null");
		}
		var oMetadata = oControl.getMetadata();
		if (!oMetadata.isInstanceOf("sap.ui.core.Label")) {
			throw new Error("sap.ui.core.LabelEnablement only supports Controls with interface sap.ui.core.Label");
		}
		var oLabelForAssociation = oMetadata.getAssociation("labelFor");
		if (!oLabelForAssociation || oLabelForAssociation.multiple) {
			throw new Error("sap.ui.core.LabelEnablement only supports Controls with a to-1 association 'labelFor'");
		}
		//Add more detailed checks here ?
	}
function checkLabelEnablementPreconditions(oControl) {
		if (!oControl) {
			throw new Error("sap.ui.core.LabelEnablement cannot enrich null");
		}
		var oMetadata = oControl.getMetadata();
		if (!oMetadata.isInstanceOf("sap.ui.core.Label")) {
			throw new Error("sap.ui.core.LabelEnablement only supports Controls with interface sap.ui.core.Label");
		}
		var oLabelForAssociation = oMetadata.getAssociation("labelFor");
		if (!oLabelForAssociation || oLabelForAssociation.multiple) {
			throw new Error("sap.ui.core.LabelEnablement only supports Controls with a to-1 association 'labelFor'");
		}
		//Add more detailed checks here ?
	}
function checkLabelEnablementPreconditions ( oControl ) { if ( ! oControl ) { throw new Error ( "sap.ui.core.LabelEnablement cannot enrich null" ) ; } var oMetadata = oControl . getMetadata ( ) ; if ( ! oMetadata . isInstanceOf ( "sap.ui.core.Label" ) ) { throw new Error ( "sap.ui.core.LabelEnablement only supports Controls with interface sap.ui.core.Label" ) ; } var oLabelForAssociation = oMetadata . getAssociation ( "labelFor" ) ; if ( ! oLabelForAssociation || oLabelForAssociation . multiple ) { throw new Error ( "sap.ui.core.LabelEnablement only supports Controls with a to-1 association 'labelFor'" ) ; } //Add more detailed checks here ? }
Checks whether enrich function can be applied on the given control or prototype.
Checks whether enrich function can be applied on the given control or prototype .