Is required to repaint the control or its snippet?
@param  string  snippet name
@return bool
324
public function isControlInvalid($snippet = NULL)
	{
		if ($snippet === NULL) {
			if (count($this->invalidSnippets) > 0) {
				return TRUE;

			} else {
				$queue = [$this];
				do {
					foreach (array_shift($queue)->getComponents() as $component) {
						if ($component instanceof IRenderable) {
							if ($component->isControlInvalid()) {
								// $this->invalidSnippets['__child'] = TRUE; // as cache
								return TRUE;
							}

						} elseif ($component instanceof Nette\ComponentModel\IContainer) {
							$queue[] = $component;
						}
					}
				} while ($queue);

				return FALSE;
			}

		} elseif (isset($this->invalidSnippets[$snippet])) {
			return $this->invalidSnippets[$snippet];
		} else {
			return isset($this->invalidSnippets["\0"]);
		}
	}
488777
public function isElementNillable($name)
    {
        foreach ($this->element->getElementsByTagName('element') as $element) {
            if ($element->getAttribute('name') == $name && $element->getAttribute('nillable') == true) {
                return true;
            }
        }
        return false;
    }
1327840
function(name) {
			var element = this.get(name);
			if (element) {
				this._updateSource('', element.fullRange());
				var ix = this._children.indexOf(element);
				if (~ix) {
					this._children.splice(ix, 1);
				}
			}
		}
503184
public function allowsElement($name)
    {
        if (!empty($this->currentNesting)) {
            $parent_token = array_pop($this->currentNesting);
            $this->currentNesting[] = $parent_token;
            $parent = $this->htmlDefinition->info[$parent_token->name];
        } else {
            $parent = $this->htmlDefinition->info_parent_def;
        }
        if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) {
            return false;
        }
        // check for exclusion
        for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
            $node = $this->currentNesting[$i];
            $def  = $this->htmlDefinition->info[$node->name];
            if (isset($def->excludes[$name])) {
                return false;
            }
        }
        return true;
    }
1297883
protected function markChanged($name)
    {
        $diffVar = &$this->changedData;
        foreach (explode('.', $name) as $namePart) {
            if (!isset($diffVar[$namePart])) {
                $diffVar[$namePart] = [];
            }
            $diffVar = &$diffVar[$namePart];

            // Already diffed
            if ($diffVar === true) {
                return;
            }
        }
        // Mark changed
        $diffVar = true;
    }
347577
public function findFormControlByName(string $name): ?Control
  {
    foreach ($this->controls as $control)
    {
      if ($control->name===$name) return $control;

      if ($control instanceof ComplexControl)
      {
        $tmp = $control->findFormControlByName($name);
        if ($tmp) return $tmp;
      }
    }

    return null;
  }
908150
public static function buildLabel($name, $label = '', $required = false)
        {
            $out = '';

            if (!empty($label)) {
                $class = 'control-label';
                $requiredLabel = '.req';
                $requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';
                $requiredPrefix = '';
                $requiredClass = 'labelrequired';

                if (false !== $required) {
                    $label = $requiredPrefix . $label . $requiredSuffix;
                    $class .= ' ' . $requiredClass;
                }

                $out .= static::label($name, $label, array('class' => $class));
            }

            return $out;
        }
980234
public function isElementInTable(string $name): bool
    {
        return $this->context->getElementByText($name, $this->fields['listElement']) !== null;
    }
174660
public function hasCommand($name) {
        if (!$this->docoptResult)
            return false;

        if ($this->isCommand($name)) {
            $value = $this->docoptResult[$name];
            if (is_int($value) && $value > 1)
                return $value;
            return (bool) $value;
        }
        return false;
    }
528257
private function isIgnoredAnnotation($name)
    {
        if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
            return true;
        }

        foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) {
            $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\';

            if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) {
                return true;
            }
        }

        return false;
    }
854071
public function printSnippets($targetName, array $snippets)
    {
        $message = $this->translator->trans('snippet_proposal_title', array('%1%' => $targetName), 'output');

        $this->output->writeln('--- ' . $message . PHP_EOL);

        foreach ($snippets as $snippet) {
            $this->output->writeln(sprintf('<snippet_undefined>%s</snippet_undefined>', $snippet->getSnippet()) . PHP_EOL);
        }
    }
300842
public function isCommandEnabled($name)
    {
        if (!empty(self::$config['application']['disabled_commands'])
            && in_array($name, self::$config['application']['disabled_commands'])) {
            return false;
        }
        if (!empty(self::$config['application']['experimental_commands'])
            && in_array($name, self::$config['application']['experimental_commands'])) {
            return !empty(self::$config['experimental']['all_experiments'])
                || (
                    !empty(self::$config['experimental']['enable_commands'])
                    && in_array($name, self::$config['experimental']['enable_commands'])
                );
        }

        return true;
    }
277162
public static boolean isSegmented(Name name, byte marker) {
    return name.size() > 0 && name.get(-1).getValue().buf().get(0) == marker;
  }
462073
private function hasFormProtection(string $name): bool
    {
        $key = $this->getSessionKey($name);

        return $this->session->has($key);
    }
438934
public function isDirty($name)
    {
        /** @type Field_Base $field */
        $field = $this->getElement($name);

        return $this->dirty[$name] ||
            (!$this->loaded() && $field->has_default_value);
    }
1215760
public function setEnabled($name)
    {
        $this->checkIfSnippetExists($name);
        $this->snippets[$name]['enabled'] = true;
        return $this;
    }
693659
public function isElementSelectable(string $name): bool
    {
        $position = $this->context->getElementPositionByText($name, $this->fields['listElement']);
        $checkbox = $this->context->findElement(sprintf($this->fields['tableCell'], $position, 1) . $this->fields['checkboxInput'])->getAttribute('disabled');

        return $checkbox !== 'disabled';
    }