Fast setting for icon

@param $icon
@param bool|true $is_icon_only
@return $this
515625
public function icon($icon, $is_icon_only = true)
    {
        $this->setIcon($icon);
        ($is_icon_only) ? $this->enableIconOnly() : $this->disableIconOnly();
        return $this;
    }
428801
public static function createIcon(string $icon, array $arguments = null) {
		$element = Html::el("i");
		
		if($icon == "b" or $icon == "l" or $icon == "s" or $icon == "r") {
			// Markup of icon which use Font Awesome 5.
			$class = ["fa".$icon];
		} else {
			// Markup of icon which use Font Awesome 4.
			$class = ["fa fa-".$icon];
		}
		
		if(isset($arguments)) {
			foreach($arguments as $argument) {
				$class[] = "fa-".$argument;
			}
		}
		
		$element->addAttributes(["class" => $class, "aria-hidden" => "true"]);
		return $element;
	}
82638
protected function iconExists($icon)
    {
        foreach ($this->icons as $group) {
            foreach ($group as $entry) {
                if (!is_array($entry)) {
                    continue;
                }

                if ($entry['value'] === $icon) {
                    return true;
                }
            }
        }

        return false;
    }
1355645
protected function _customIcon($icon, array $options = [], array $attributes = []) {
		$translate = isset($options['translate']) ? $options['translate'] : true;

		$type = pathinfo($icon, PATHINFO_FILENAME);
		$title = ucfirst($type);
		$alt = $this->slug($title);
		if ($translate !== false) {
			$title = __($title);
			$alt = __($alt);
		}
		$alt = '[' . $alt . ']';

		$defaults = ['title' => $title, 'alt' => $alt, 'class' => 'icon'];

		$options = $attributes + $options;
		$options += $defaults;
		if (substr($icon, 0, 1) !== '/') {
			$icon = 'icons/' . $icon;
		}
		return $this->Html->image($icon, $options);
	}
154283
public function addIcon($icon,$before=true,$labeled=false){
		$iconO=$icon;
		if(\is_string($icon)){
			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
		}
		if($labeled!==false){
			$direction=($before===true)?Direction::LEFT:Direction::RIGHT;
			$this->addToProperty("class", $direction." labeled icon");
			$this->tagName="div";
		}
		$this->addContent($iconO,$before);
		return $iconO;
	}
240265
public function setIconPosition($iconPosition)
    {
        switch ($iconPosition) {
            case self::ICON_PREPEND:
            case self::ICON_APPEND:
                $this->iconPosition = $iconPosition;
                break;
            default:
                throw new Exception\InvalidArgumentException('Invalid icon position given');
        }
        return $this;
    }
579088
public function setType($type)
    {
        if ($type === null) {
            $this->$type = $type;
        } else {
            $iconSetType = new IconSetTypeEnum($type);
            $this->type = $iconSetType->getValue();
        }

        return $this;
    }
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;
    }
211259
public function setIconURL($iconURL)
    {
        /*
         * TODO validate the actual URL?
         */
        $this->iconURL = (empty((string) $iconURL) ? false : (string) $iconURL);
    }
67660
protected function setIcon($icon)
    {
        if (is_string($icon) === false) {
            throw new \InvalidArgumentException(
                'The icon label must be a string.'
            );
        }

        $this->icon = $icon;

        return $this;
    }
1042315
public function setLabel($label)
    {
        if (is_array($label) && $label['icon']) {
            $this->setIcon($label['icon']);
        } elseif (is_string($label)) {
            return $this->setText($label);
        }

        return $this;
    }
1184306
protected function buildIconClasses($icon)
    {
        //Prepends the string "fa-" to any other class
        $icon = preg_replace('/(?<![^ ])(?=[^ ])(?!fa)/', 'fa-', $icon);
        $icon = !is_array($icon) ? preg_split('/\s+/', $icon, -1, PREG_SPLIT_NO_EMPTY) : $icon;

        //Adds the "fa" class, if no other "basic" class is present
        if (!count(array_intersect(['fa', 'fab', 'fal', 'far', 'fas'], $icon))) {
            array_unshift($icon, 'fas');
        }

        return implode(' ', array_unique($icon));
    }
1170644
public function icons(array $icons = null)
    {
        foreach ($this->fixIconsArray(($icons ?: $this->icons)) as $icon) {
            $this->add($icon);
        }
        return $this;
    }
944012
public function setIcon($icon)
    {
        switch ($icon) {
            case 'info':
            case 'error':
            case 'warning':
                $this->icon = $icon;
                break;
            default:
                if (file_exists($icon) && is_file($icon)) {
                    $this->icon = $icon;
                } else {
                    if (isset($this->log)) {
                        $this->log(
                            sprintf(
                                "%s is not a file. Using default icon instead.",
                                $icon
                            ),
                            Project::MSG_WARN
                        );
                    }
                }
        }
    }
692812
def set_icon(self, bmp):
        """"""

        _icon = wx.EmptyIcon()
        _icon.CopyFromBitmap(bmp)
        self.SetIcon(_icon)
512082
public function setIcon($icon)
    {
        if ($icon[0] != '<') {
            $icon = '<i class="icon-'.$icon.'"></i>';
        }
        $this->template->trySetHTML('icon', $icon);

        return $this;
    }
735492
public function icon($icon, $color = null, bool $animated = null):self
    {
        Checkers::checkIcon($icon, null, $this->iconIsNullable);
        $this->icon = $icon;
        $this->setIconColor($color);
        $this->iconAnimated = $animated !== null ? $animated : $this->iconAnimated;
        return $this;
    }