Find first widget with given name among parents of the given widget (including widget itself)
@param {Lava.widget.Standard} widget Starting widget
@param {string} name Name to search for
@returns {?Lava.widget.Standard}
979650
function(widget, name) {

		if (Lava.schema.DEBUG && !name) Lava.t();

		while (widget && widget.name != name) {

			widget = widget.getParentWidget();

		}

		return widget;

	}
642031
public static Component getDescendantNamed(String name, Component parent) {

        Assert.notNull(name, "name");
        Assert.notNull(parent, "parent");

        if (name.equals(parent.getName())) { // Base case
            return parent;
        } else if (parent instanceof Container) { // Recursive case
            for (final Component component : ((Container) parent).getComponents()) {

                final Component foundComponent = SwingUtils.getDescendantNamed(name, component);

                if (foundComponent != null) {
                    return foundComponent;
                }
            }
        }

        return null;
    }
486932
function(json, name, type) {
  if (json && json.widget) {
    var nodes = json.widget[type];

    if (!!nodes && isArray(nodes)) {
      for (var i = 0; i < nodes.length; i++) {
        if (nameIsMatch(nodes[i], name)) {
          return true;
        }
      }
    }
  }

  return false;
}
910457
function (name) {
    var dotPos = name.indexOf('.');
    if (dotPos > -1) {
      name = name.substring(0, dotPos);
    }
    return name;
  }
98535
static boolean isElementParentName(Element element, String name) {
        Element parent = element.getParentElement();
        if (parent == null) {
            return false;
        }
        return isElementName(parent, name);
    }
149369
function(name) {

		var result = [],
			i = 0;

		for (; i < this._count; i++) {

			if (this._content[i].isWidget && this._content[i].name == name) {

				result.push(this._content[i]);

			}

		}

		return result;

	}
958505
public Object getFirst(String name) {
    Object value = get(name);
    if (value instanceof Collection<?>) {
      @SuppressWarnings("unchecked")
      Collection<Object> collectionValue = (Collection<Object>) value;
      Iterator<Object> iterator = collectionValue.iterator();
      return iterator.hasNext() ? iterator.next() : null;
    }
    return value;
  }
236572
function(starting_widget, id) {

		if (Lava.schema.DEBUG && !id) Lava.t();

		return this._views_by_id[id];

	}
1350234
public boolean startsWith(Name name) {
		if (name.size() == 0) {
			return false;
		}

		DistinguishedName start = null;
		if (name instanceof DistinguishedName) {
			start = (DistinguishedName) name;
		}
		else {
			return false;
		}

		if (start.size() > this.size()) {
			return false;
		}

		Iterator longiter = names.iterator();
		Iterator shortiter = start.getNames().iterator();

		while (shortiter.hasNext()) {
			Object longname = longiter.next();
			Object shortname = shortiter.next();

			if (!longname.equals(shortname)) {
				return false;
			}
		}

		// All names in shortiter matched.
		return true;
	}
665278
def first_child_found_in(self, *tagnames):
        
        for tagname in tagnames:
            child = self.find(qn(tagname))
            if child is not None:
                return child
        return None
528855
function (name) {
        var children = this._children;
        for (var i = 0; i < children.length; i++) {
            var child = children[i];
            if (child.name === name) {
                return child;
            } else {
                var res = child.getDescendantByName(name);
                if (res) {
                    return res;
                }
            }
        }
    }
609761
public String getWidgetDefaultConfiguration(String name) {

        if (m_registeredWidgets.containsKey(name)) {
            return m_widgetDefaultConfigurations.get(name);
        }
        // not found by class name, look up an alias
        String className = m_widgetAliases.get(name);
        if (className != null) {
            return m_widgetDefaultConfigurations.get(className);
        }
        return null;
    }
68561
public function first($name)
    {
        if ($this->hasValue($name)) {
            return $this->getValue($name);
        }

        foreach ($this->getStructures() as $childStructure) {
            if ($result = $childStructure->first($name)) {
                return $result;
            }
        }

        return null;
    }
119164
public I_CmsWidget getWidget(String name) {

        // first look up by class name
        I_CmsWidget result = m_registeredWidgets.get(name);
        if (result == null) {
            // not found by class name, look up an alias
            String className = m_widgetAliases.get(name);
            if (className != null) {
                result = m_registeredWidgets.get(className);
            }
        }
        if (result != null) {
            result = result.newInstance();
        }
        return result;
    }
664275
function (name) {
        var children = this._children;
        for (var i = 0; i < children.length; i++) {
            if (children[i].name === name) {
                return children[i];
            }
        }
    }
859385
public String getFirst(String name)
    {
        HeaderName hn = getHeaderName(name);
        return getFirst(hn);
    }
851234
private Transition find(String name) {
        for (Transition t : transitions) {
            if (t.getName().matches(name)) {
                return t;
            }
        }
        return null;
    }