Checks if this child holds the current active state.
If the child is or contains the active state it is applied.
775189
protected void checkActiveState(Widget child) {
        // Check if this widget has a valid href
        String href = child.getElement().getAttribute("href");
        String url = Window.Location.getHref();
        int pos = url.indexOf("#");
        String location = pos >= 0 ? url.substring(pos, url.length()) : "";

        if (!href.isEmpty() && location.startsWith(href)) {
            ListItem li = findListItemParent(child);
            if (li != null) {
                makeActive(li);
            }
        } else if (child instanceof HasWidgets) {
            // Recursive check
            for (Widget w : (HasWidgets) child) {
                checkActiveState(w);
            }
        }
    }
547943
def process(self):
        
        children = len(self.living_children)
        LOGGER.debug('%i active child%s',
                     children, '' if children == 1 else 'ren')
1296039
public boolean isActive() {
    final Project project = getProject();
    if (!CUtil.isActive(project, this.ifProp, this.unlessProp)) {
      return false;
    }
    return true;
  }
120406
@Override
    public boolean isTransactionActive() {

        if (this.getTransactionManager() != null)
            try {
                if (this.getTransactionManager().getStatus() == Status.STATUS_ACTIVE)
                    return true;

            } catch (SystemException se) {
                if (TC.isDebugEnabled()) {
                    Tr.debug(TC, "Returning isTransactionActive() false: " + se.getMessage());
                }
                return false;
            }
        return false;
    }
525393
public boolean isActive()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null)
        {
            return facesContext.getViewRoot() != null;
        }
        else
        {
            // No FacesContext means no view scope active.
            return false;
        }
    }
734091
public function hasChildrenVisible()
    {
        foreach ($this->getChildren() as $child) {
            if ($child->getState() == static::STATE_ONLINE) {
                return true;
            }
        }

        return false;
    }
953072
protected void updateState() {
        final WidgetState.State state;
        if (useParentState() || getFollowParentState()) {
            state = mParent.getState();
        } else {
            state = getState();
        }

        Log.d(Log.SUBSYSTEM.WIDGET, TAG, "updateState(): %s for '%s'", state, getName());
        if (!mLevelInfo.isEmpty() && mLevel >= 0) {
            mLevelInfo.get(mLevel).setState(state);
        }

        boolean updateChildren = isInFollowStateGroup()
                || getChildrenFollowState();
        for (Widget child : getChildren()) {
            if (updateChildren || child.getFollowParentState()) {
                child.updateState();
            }
        }
    }
312486
def has_active_condition(self, condition, instances):
        
        return_value = None
        for instance in instances + [None]:
            if not self.can_execute(instance):
                continue
            result = self.is_active(instance, condition)
            if result is False:
                return False
            elif result is True:
                return_value = True
        return return_value
423089
public function isVoided()
    {
        if ($this->parent) {
            return $this->parent->isVoided();
        }

        return $this->children->exists(function($key, Transaction $child) {
            return $child->getType() == Transaction\TransactionType::VOID && $child->getStatus() == Result\ResultStatus::APPROVED;
        });
    }
84290
def mark_as_inactive(self, kid):
        
        k = self.get_key_with_kid(kid)
        k.inactive_since = time.time()
911388
public boolean markInactive() {
		if (TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state) {
			state = TaskSlotState.ALLOCATED;

			return true;
		} else {
			return false;
		}
	}
454017
public function isActive() {
        if (!$this->getValue(
                self::KEY_ACTIVE,
                $this->storeManager->getStore()
            )) {
            return false;
        }

        $quote = $this->checkoutSession->getQuote();

        return (bool) in_array($quote->getQuoteCurrencyCode(), $this->getAcceptedCurrencies());
    }
602732
public function active()
    {
        $classes = $this->getAdaptee()->classes;

        foreach ($classes as $class) {
            if (strpos($class, 'current') !== false) {
                return true;
            }
        }

        return false;
    }
6356
def is_active(self, key, *instances, **kwargs):
        
        default = kwargs.pop('default', False)

        # Check all parents for a disabled state
        parts = key.split(':')
        if len(parts) > 1:
            child_kwargs = kwargs.copy()
            child_kwargs['default'] = None
            result = self.is_active(':'.join(parts[:-1]), *instances, **child_kwargs)

            if result is False:
                return result
            elif result is True:
                default = result

        try:
            switch = self[key]
        except KeyError:
            # switch is not defined, defer to parent
            return default

        if switch.status == GLOBAL:
            return True
        elif switch.status == DISABLED:
            return False
        elif switch.status == INHERIT:
            return default

        conditions = switch.value
        # If no conditions are set, we inherit from parents
        if not conditions:
            return default

        if instances:
            # HACK: support request.user by swapping in User instance
            instances = list(instances)
            for v in instances:
                if isinstance(v, HttpRequest) and hasattr(v, 'user'):
                    instances.append(v.user)

        # check each switch to see if it can execute
        return_value = False

        for switch in self._registry.itervalues():
            result = switch.has_active_condition(conditions, instances)
            if result is False:
                return False
            elif result is True:
                return_value = True

        # there were no matching conditions, so it must not be enabled
        return return_value
1227722
public function isActive($recursive = false)
        {
            if (!$this->_active && $recursive) {
                foreach ($this->_pages as $page) {
                    if ($page->isActive(true)) {
                        return true;
                    }
                }

                return false;
            }

            return $this->_active;
        }
997922
public boolean isActive(final org.apache.tools.ant.Project p) {
    if (this.value == null) {
      return false;
    }
    if (this.ifCond != null && p.getProperty(this.ifCond) == null) {
      return false;
    } else if (this.unlessCond != null && p.getProperty(this.unlessCond) != null) {
      return false;
    }
    return true;
  }
1082479
protected function isChildActive($items, &$active)
    {
        foreach ($items as $i => $child) {
            if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
                Html::addCssClass($items[$i]['options'], 'active');
                if ($this->activateParents) {
                    $active = true;
                }
            }
            if (isset($child['items']) && is_array($child['items'])) {
                $child['items'] = $this->isChildActive($child['items'], $active);
            }
        }
        return $items;
    }