/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['sap/ui/core/library', 'sap/ui/core/ValueStateSupport', 'sap/ui/Device'], function(coreLibrary, ValueStateSupport, Device) { "use strict"; // shortcut for sap.ui.core.ValueState var ValueState = coreLibrary.ValueState; /** * CheckBox renderer. * @namespace */ var CheckBoxRenderer = { }; /** * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the Render-Output-Buffer * @param {sap.ui.core.Control} oCheckBox An object representation of the control that should be rendered */ CheckBoxRenderer.render = function(oRm, oCheckBox){ // get control properties var sId = oCheckBox.getId(), bEnabled = oCheckBox.getEnabled(), bDisplayOnly = oCheckBox.getDisplayOnly(), bEditable = oCheckBox.getEditable(), bInteractive = bEnabled && !bDisplayOnly, bDisplayOnlyApplied = bEnabled && bDisplayOnly, oCbLabel = oCheckBox.getAggregation("_label"), sValueState = oCheckBox.getValueState(), bInErrorState = ValueState.Error === sValueState, bInWarningState = ValueState.Warning === sValueState, bInInformationState = ValueState.Information === sValueState, bUseEntireWidth = oCheckBox.getUseEntireWidth(); // CheckBox wrapper oRm.write(""); // DIV element // write the HTML into the render manager oRm.write("
"); // DIV element oRm.write("
"); oRm.renderControl(oCbLabel); if (sTooltip && sap.ui.getCore().getConfiguration().getAccessibility()) { // for ARIA, the tooltip must be in a separate SPAN and assigned via aria-describedby. // otherwise, JAWS does not read it. oRm.write(""); oRm.writeEscaped(sTooltip); oRm.write(""); } oRm.write(""); }; return CheckBoxRenderer; }, /* bExport= */ true);