Set an icon from fontawesome icon.
Use only the name without the leading "fa-"

@param string $icon

@return \Core\Html\controls\UiButton
184155
public function setIcon($icon)
    {
        $this->icon = $this->factory->create('Fontawesome\Icon');
        $this->icon->setIcon($icon);

        return $this;
    }
1055789
public function icon($icon = null)
    {
        if (null !== $icon) {
            $this->icon = $icon;

            return $this;
        }

        return $this->icon;
    }
1084853
protected PushButton createIconButton(String icon) {

        CmsPushButton button = new CmsPushButton();
        button.setImageClass(icon);
        button.setButtonStyle(ButtonStyle.FONT_ICON, null);
        return button;
    }
77241
public function icon($icon = 'home', array $options = [])
    {
        $iconPref = $this->_configRead('iconPref');
        $_classes = [
            $this->_class(__FUNCTION__),
            $iconPref,
            $iconPref . '-' . $icon,
        ];

        $options = $this->_addClass($options, implode(' ', $_classes));
        $classes = $options['class'];
        unset($options['class']);

        $templater = $this->templater();
        return $templater->format(__FUNCTION__, [
            'class' => $classes,
            'attrs' => $templater->formatAttributes($options),
        ]);
    }
1006003
public static function icon($icon, $type = self::FONT_AWESOME)
    {
        $class = null;

        if ($type === self::FONT_AWESOME) {
            $class = 'fa fa-' . $icon;

        }
        else if ($type === self::FONT_BOOTSTRAP) {
            $class = 'glyphicon glyphicon-' . $icon;
        }
        else {
            $class = $icon;
        }

        return self::tag('i', '', $class, '');
    }
722848
public void setIcon(Icon icon) {
        Icon old = null;
        if (iconInfo == CommandButtonIconInfo.BLANK_ICON_INFO) {
            if (icon != null) {
                // New IconInfo fires event
                setIconInfo(new CommandButtonIconInfo(icon));
            }
        }
        else {
            old = iconInfo.getIcon();
            this.iconInfo.setIcon(icon);
        }
        firePropertyChange(ICON_PROPERTY, old, icon);
    }
461881
public function setIcon($icon) {
		if (isset($this->_icon)) {
			$this->removePropertyValue("class", $this->_icon);
		}
		$this->_icon=$icon;
		$this->addToProperty("class", $icon);
		return $this;
	}
829724
protected function replaceIconName($iconName)
	{
		return isset($this->replaceMap[$iconName]) ? $this->replaceMap[$iconName] : $iconName;
	}
1346143
@NonNull
    public IconicsDrawable icon(@NonNull String icon) {
        try {
            ITypeface font = Iconics.findFont(mContext, icon.substring(0, 3));
            icon = icon.replace("-", "_");
            icon(font.getIcon(icon));
        } catch (Exception ex) {
            Log.e(Iconics.TAG, "Wrong icon name: " + icon);
        }
        return this;
    }
170799
public UIImage setIcon(GuiIcon icon)
	{
		this.itemStack = null;
		this.icon = icon;
		setForeground(ICON_RENDER);
		return this;
	}
1274517
public function iconFunction($icon)
    {
        $icon = str_replace('+', ' '.$this->iconPrefix.'-', $icon);

        return sprintf('<%1$s class="%2$s %2$s-%3$s"></%1$s>', $this->iconTag, $this->iconPrefix, $icon);
    }
422465
public static function getIconName($icon){
        $icon   = is_scalar($icon) ? $icon : self::ICON_NULL;
        
        return self::ICON_NAMES[$icon] ?? self::ICON_NAMES[self::ICON_NULL];
    }
709309
public function setNoText($icon = null)
    {
        $this->options['text'] = false;
        if ($icon !== null) {
            $this->setIcon($icon);
        }

        return $this;
    }
1211686
public function setIcon($icon)
    {
        if ($icon instanceof Icon) {
            $this->icon = $icon;
        } else {
            $this->icon = new Icon($icon);
        }

        return $this;
    }
1361094
public static function icon($icon, $size = 0, $tag = 'i')
    {
        $icon = preg_replace('/(")(.*?)(")/', '$2', $icon);

        $icon_array = explode(',', $icon, 2);
        $icon = array_get($icon_array, 0);
        if (array_has($icon_array, 1)) {
            $attributes = explode(',', array_get($icon_array, 1, ''));
        }

        if (substr($icon, 1, 1) == ' ') {
            $type = substr($icon, 0, 1);
            $icon = substr($icon, 2);
        } else {
            $type = config('html.icon.default.type', 'l');
        }
        $icon = ($icon[0] === '-') ? substr($icon, 1) : 'fa-'.$icon;
        $size = ($size > 0) ? ' fa-'.$size : '';
        $fa = self::$tag()->addClass('fa'.$type.' fa-fw '.$icon.$size)->aria('hidden', 'true');

        if (isset($attributes) && is_array($attributes)) {
            foreach ($attributes as $attr) {
                list($attr_name, $attr_value) = explode('=', $attr);
                switch ($attr_name) {
                    case 'transform':
                        $fa->data('fa-'.$attr_name, $attr_value);
                        break;
                    default:
                        $fa->attr($attr_name, $attr_value);
                        break;
                }
            }
        }

        return $fa;
    }
684022
public function setIcon(string $icon = null): ButtonInterface
    {
        if ($this->isVisibility()) {
            $this->icon = $icon;
        }

        return $this;
    }
828360
public function icon($icon, array $options = [], array $attributes = []) {
		if (!$icon) {
			return '';
		}

		$defaults = [
			'translate' => true,
		];
		$options += $defaults;

		$type = $icon;
		if ($this->getConfig('autoPrefix') && empty($options['iconNamespace'])) {
			$namespace = $this->detectNamespace($icon);
			if ($namespace) {
				$options['iconNamespace'] = $namespace;
				$options['autoPrefix'] = false;
				$icon = substr($icon, strlen($namespace) + 1);
			}
		}

		if (!isset($attributes['title'])) {
			if (isset($options['title'])) {
				$attributes['title'] = $options['title'];
			} else {
				$attributes['title'] = Inflector::humanize($icon);
			}
		}

		return $this->_fontIcon($type, $options, $attributes);
	}