Set icon name.

@param string|null $icon Symbolic icon name
@return $this
438244
public function setIcon( $icon = null ) {
		if ( $this->iconName !== null ) {
			$this->icon->removeClasses( [ 'oo-ui-icon-' . $this->iconName ] );
		}
		if ( $icon !== null ) {
			$this->icon->addClasses( [ 'oo-ui-icon-' . $icon ] );
		}

		$this->iconName = $icon;
		$this->toggleClasses( [ 'oo-ui-iconElement' ], (bool)$this->iconName );
		$this->icon->toggleClasses( [ 'oo-ui-iconElement-noIcon' ], !$this->iconName );

		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;
	}
321041
public function setSize(string $size): Icon
    {
        // sizes which are allowed
        $sizes = [
            'lg',
            '2x',
            '3x',
            '4x'
        ];

        if (!in_array($size, $sizes)) {
            Throw new IconException('Wrong size set.');
        }

        $this->size = $size;

        return $this;
    }
252991
private function setIcon()
    {
        if (!$this->slackConfig->getCustomUser()->hasIcon()) {
            return;
        }

        $iconType = 'icon_' . $this->slackConfig->getCustomUser()->getIcon()->getType();
        $this->payload[$iconType] = $this->slackConfig->getCustomUser()->getIcon();
    }
578532
protected function render_pix_icon(pix_icon $icon) {
        $system = \core\output\icon_system::instance();
        return $system->render_pix_icon($this, $icon);
    }
447808
protected function createIcon($iconName)
	{
		if (is_callable($this->createIconCallback)) {
			return call_user_func($this->createIconCallback, $iconName);
		} else {
			return Icon::create($iconName);
		}
	}
666160
public function icon()
    {
        if ($this->icon === null) {
            $this->parts['{icon}'] = '';
            return $this;
        }

        $this->parts['{icon}'] = Icon::widget([
            'name' => ArrayHelper::getValue($this->icon, 'name', null),
            'position' => 'prefix',
            'options' => ArrayHelper::getValue($this->icon, 'options', [])
        ]);

        return $this;
    }
114372
protected static function setIconAttribute(array $properties)
    {
        $icon = array_get($properties, 'attributes.icon');
        if (!is_null($icon)) {
            $properties['icon'] = $icon;

            array_forget($properties, 'attributes.icon');

            return $properties;
        }

        return $properties;
    }
701531
@NonNull
    public IconicsDrawable iconText(@NonNull String icon, @Nullable Typeface typeface) {
        mPlainIcon = icon;
        mIcon = null;
        mIconBrush.getPaint().setTypeface(typeface == null ? Typeface.DEFAULT : typeface);

        invalidateSelf();
        return this;
    }
1113948
protected function setMask($icon, $style='fas')
    {
        if (is_string($icon) === false) {
            throw new \InvalidArgumentException(
                'The mask icon label must be a string.'
            );
        }
        if (is_string($style) === false) {
            throw new \InvalidArgumentException(
                'The mask style label must be a string.'
            );
        }
        if (!in_array($style, $this->STYLES)) {
            throw new \InvalidArgumentException(
                'Invalid mask style.'
            );
        }

        $this->mask = $style." fa-".$icon;

        return $this;
    }
571908
public function setLogo($logo = null)
    {
        // @TODO: Ugly hack to avoid $form->handleRequest() changing this value from null to empty array
        if (is_array($logo)) {
            $logo = null;
        }

        $this->logo = $logo;

        return $this;
    }
527610
public function setName($name) {
    $this->reflection = NULL;
    $this->name = trim($name, '\\');
    return $this;
  }
637446
public function setIcon(?string $icon): self
    {
        if (null === $icon) {
            $this->icon = $this->iconType = null;

            return $this;
        }

        if (':' === \mb_substr($icon, 0, 1) && ':' === \mb_substr($icon, \mb_strlen($icon) - 1, 1)) {
            $this->iconType = self::ICON_TYPE_EMOJI;
        } else {
            $this->iconType = self::ICON_TYPE_URL;
        }

        $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;
    }
399642
public function addIconMetric(string $name, $icon){
        if(!array_key_exists($icon, self::ICON_NAMES)){
            throw new \InvalidArgumentException();
        }

        $this->addMetric(
            trim($name),
            self::TYPE_ICON,
            [
                "icon"  => $icon,
            ]
        );
    }
829724
protected function replaceIconName($iconName)
	{
		return isset($this->replaceMap[$iconName]) ? $this->replaceMap[$iconName] : $iconName;
	}
134018
def setIcon(self, icon):
        
        icon = QIcon(icon)
        if icon.isNull():
            self._icon = None
            self._style = XNodeHotspot.Style.Invisible
        else:
            self._icon = icon
            self._style = XNodeHotspot.Style.Icon