/**
* Render a button.
*
* @param array &$node A toolbar node.
*
* @return string
*
* @since 1.5
* @throws \Exception
*/
public function renderButton(&$node)
{
// Get the button type.
$type = $node[0];
$button = $this->loadButtonType($type);
// Check for error.
if ($button === false) {
throw new \UnexpectedValueException(Text::sprintf('JLIB_HTML_BUTTON_NOT_DEFINED', $type));
}
$button->setParent($this);
return $button->render($node);
}