/*! * 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/ValueStateSupport', 'sap/ui/core/library', 'sap/ui/Device'], function(ValueStateSupport, coreLibrary, Device) { "use strict"; // shortcut for sap.ui.core.ValueState var ValueState = coreLibrary.ValueState; /** * RadioButton renderer. * @namespace */ var RadioButtonRenderer = {}; /** * 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} oRadioButton an object representation of the control that should be rendered */ RadioButtonRenderer.render = function(oRm, oRadioButton) { // get control properties var sId = oRadioButton.getId(); var bEnabled = oRadioButton.getEnabled(); var bEditable = oRadioButton.getEditable(); var bReadOnly = !bEnabled || !bEditable; var bInErrorState = ValueState.Error === oRadioButton.getValueState(); var bInWarningState = ValueState.Warning === oRadioButton.getValueState(); var bInInformationState = ValueState.Information === oRadioButton.getValueState(); var bUseEntireWidth = oRadioButton.getUseEntireWidth(); // Radio Button style class oRm.addClass("sapMRb"); // write the HTML into the render manager oRm.write("