protected function addAttributesToRender($writer)
{
if ($this->getID() !== '' || $this->getEnsureId()) {
$writer->addAttribute('id', $this->getClientID());
}
if (($accessKey = $this->getAccessKey()) !== '') {
$writer->addAttribute('accesskey', $accessKey);
}
if (!$this->getEnabled()) {
$writer->addAttribute('disabled', 'disabled');
}
if (($tabIndex = $this->getTabIndex()) > 0) {
$writer->addAttribute('tabindex', "{$tabIndex}");
}
if (($toolTip = $this->getToolTip()) !== '') {
$writer->addAttribute('title', $toolTip);
}
if ($style = $this->getViewState('Style', null)) {
$style->addAttributesToRender($writer);
}
if ($this->getHasAttributes()) {
foreach ($this->getAttributes() as $name => $value) {
$writer->addAttribute($name, $value);
}
}
}