Set the label.

An empty string will result in the label being hidden. A string containing only whitespace will
be converted to a single `&nbsp;`.

@param string|HtmlSnippet|null $label Label text
@return $this
178620
public function setLabel( $label ) {
		$this->labelValue = (string)$label !== '' ? $label : null;

		$this->label->clearContent();
		if ( $this->labelValue !== null ) {
			if ( is_string( $this->labelValue ) && trim( $this->labelValue ) === '' ) {
				$this->label->appendContent( new HtmlSnippet( '&nbsp;' ) );
			} else {
				$this->label->appendContent( $label );
			}
		}

		$visibleLabel = $this->labelValue !== null && !$this->invisibleLabel;
		$this->toggleClasses( [ 'oo-ui-labelElement' ], $visibleLabel );

		return $this;
	}
584154
public function addLabel($label, $before=false, $icon=NULL) {
		$labelO=$label;
		if (\is_object($label) === false) {
			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
			if (isset($icon))
				$labelO->addIcon($icon);
		} else {
			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
		}
		$this->addContent($labelO, $before);
		return $labelO;
	}
651416
public function prepend($label): self
    {
        $label = $this->filterComponent($label);
        if (null === $label) {
            return $this;
        }

        return new self($label.self::SEPARATOR.$this->getContent());
    }
630145
public function setLabel($label)
    {
        if (Format::isString256($label) === true) {
            $this->label = $label;
        } else {
            $msg = "The label argument must be a string with at most 256 characters.";
            throw new InvalidArgumentException($msg);
        }
    }
1291124
public function hasLabel($label)
    {
        if (null !== $label) {
            $l = (string) $label;
            if ($this->labels->contains($l)) {
                return true;
            }
        }

        return false;
    }
374751
private Label createLabel(String label) {
        Pane pane = new Pane();
        root.addChild(pane);
        Label lbl = new Label();
        lbl.setName(label);
        pane.addChild(lbl);
        adjustPanes();
        return lbl;
    }
1322425
public static function init(string $value = null, string $label = null)
    {
        $instance = new static();

        $instance->option['value'] = $value;

        if ($label) $instance->option['text'] = $label;

        return $instance;
    }
98259
public final synchronized void setLabel(String label) {
        if(label == null) {
            throw new IllegalArgumentException("null label to a button is not allowed");
        }
        if(label.isEmpty()) {
            label = " ";
        }
        this.label = label;
        invalidate();
    }
485272
public function setLabel($label) {
        if (!is_string($label)) throw new IllegalTypeException('Illegal type of parameter $label: '.gettype($label));
        if (!strlen($label))    throw new InvalidArgumentException('Invalid argument $label: '.$label);

        $this->label = $label;
        return $this;
    }
335273
public function setItems($value, $label = null) {
		Argument::i()
			->test(1, 'string', 'array')
			->test(2, 'scalar', 'null')
			->test(3, 'string', 'null');
			
		if(is_array($value)) {
			$this->items = $value;
			return $this;
		}
			
		$this->items[$value] = $label;
		return $this;
	}
1297442
public function setLabels(array $labels = ['k' => 'v'])
    {
        $this->labels = $labels;

        $this->raw = array_merge($this->raw, ['Labels' => $labels]);

        return $this;
    }
388170
function btn($label, $tagbody) {
		return $this->button($label, null, $tagbody)
			->set('type', null);
	}
263580
protected function encodeLabel(string $label): string
    {
        $encoded = '';
        
        foreach (\explode('.', $label) as $part) {
            $encoded .= \chr(\strlen($part)) . $part;
        }
        
        return $encoded . "\x00";
    }
493120
public static function setConnection(string $label=null)
    {
        if ($label === null && static::$currentConnection === null) {
            static::$currentConnection = static::getDefaultLabel();
            return;
        }

        $config = static::config();
        if (isset($config[$label])) {
            static::$currentConnection = $label;
        } else {
            throw new Exception('The provided label does not exist in the config.');
        }
    }
560267
public function labels(array $labels)
    {
        foreach ($labels as $field => $label)
        {
            $this->label($field, $label);
        }

        return $this;
    }
611650
public function setLabel($label)
        {
            if (null !== $label && !is_string($label)) {
                throw new Exception(
                        'Invalid argument: $label must be a string or null');
            }

            $this->_label = $label;
            return $this;
        }
1228200
public static function prependLabel($uri, $label)
    {
        $host = new Host(self::filterUri($uri)->getHost());
        if ($host->isDomain()) {
            return $uri->withHost((string) (new Domain($host))->prepend($label));
        }

        if ($host->isIpv4()) {
            $label = rtrim((string) new Host($label), '.');

            return $uri->withHost((string) $host->withContent($label.'.'.$host->getContent()));
        }

        throw new SyntaxError(sprintf('The URI host %s can not be prepended', (string) $host));
    }