Set the selection state of the given node

@param node The node
@param state The state
@param propagate Whether the state change should be propagated
to its children and ancestor nodes
435103
private void setSelectionState(Object node, State state, boolean propagate)
    {
        Objects.requireNonNull(state, "The state may not be null");
        Objects.requireNonNull(node, "The node may not be null");
        State oldState = selectionStates.put(node, state);
        if (!state.equals(oldState))
        {
            fireStateChanged(node, oldState, state);
            if (propagate)
            {
                updateSelection(node);
            }
        }
        repaint();
    }
1177889
def do_node_set(self, element, decl, pseudo):
        """"""
        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree
        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('nodeset', elem)]
        else:
            self.state[valstep]['pending'][target] = [('nodeset', elem)]
1022693
function(state, data){
      var stateCode = String(state);
      var oldState = this.childNodesState;

      if (!STATE.values[stateCode])
        throw new Error('Wrong state value');

      // set new state for object
      if (oldState != stateCode || oldState.data != data)
      {
        this.childNodesState = Object(stateCode);
        this.childNodesState.data = data;

        this.emit_childNodesStateChanged(oldState);
      }
    }
1357767
private void toggleSelection(TreePath path)
    {
        Object node = path.getLastPathComponent();
        State state = getSelectionState(node);
        if (state == null)
        {
            return;
        }
        if (state == State.SELECTED)
        {
            setSelectionState(node, State.UNSELECTED);
            updateSelection(node);
        }
        else if (state == State.UNSELECTED)
        {
            setSelectionState(node, State.SELECTED);
            updateSelection(node);
        }
        else
        {
            setSelectionState(node, State.SELECTED);
            updateSelection(node);
        }
        
    }
1348917
public void setState(State state, boolean fireEvent) {

        boolean changed = m_state != state;
        m_state = state;
        if (changed) {
            updateStyle();
        }
        if (fireEvent) {
            ValueChangeEvent.fire(this, state);
        }
    }
647532
@Override
    public void setState(RelayState state) {

        // apply the new pin state
        switch(state) {
            case OPEN: {
                if(!isOpen()) {
                    pin.setState(openState);
                }
                break;
            }
            case CLOSED: {
                if(!isClosed()) {
                    pin.setState(closedState);
                }
                break;
            }
            default: {
                throw new UnsupportedOperationException("Cannot set power state: " + state.toString());
            }
        }
    }
810301
function setToggleState(ele, state) {
  const btn = "btn";
  const sel = "selected";

  if (ele.classList.contains(btn)) {
    if (state) {
      ele.classList.add(sel);
    } else {
      ele.classList.remove(sel);
    }
  }
}
17639
@Override
	public void passed(final PassedRoute passed) {
		passed.appendBranchState(getPosition(), getPosition() + getLength() - 1, getState());
		super.passed(passed);
		if (elseIfNode != null) {
			elseIfNode.passed(passed);
		}
		if (elseNode != null) {
			elseNode.passed(passed);
		}
	}
269140
public void setRightsPropagation(Boolean propagation){
		Validate.notNull(propagation);
		props.setProperty(RBACModelProperty.RIGHTS_PROPAGATION.toString(), propagation.toString());
	}
922247
function resetState(node) {
    _.each(node._tree.defaultState, (val, prop) => {
        node.state(prop, val);
    });

    return node;
}
1348064
private void setState(FieldState state) {
        if (DEBUG)
            LOG.debug("{}:{} --> {}", _state, _fieldState, state);
        _fieldState = state;
    }
1041078
protected static void setSelected(TreeElement node, String selected, ServletRequest request)
    {
        assert(node != null) : "parameter 'node' must not be null";
        assert(selected != null) : "parameter 'selected' must not be null";
        assert(request != null) : "parameter 'requested' must not be null";

        if (node.getName().equals(selected)) {
            node.onSelect(request);
            node.setSelected(true);
        }
        else {
            if (node.isSelected()) {
                node.onSelect(request);
                node.setSelected(false);
            }
        }

        TreeElement children[] = node.getChildren();
        assert(children != null);
        for (int i = 0; i < children.length; i++) {
            setSelected(children[i], selected, request);
        }
    }
405800
private void setState(State state) {
    if (this.state != state) {
      this.state = state;
      LOGGER.debug("State changed: {}", state);
      changeListeners.forEach(l -> l.accept(state));
    }
  }
507374
public void putDestination(List<Descriptor> descriptors, int branchId, State state) {

    if (!hasLineageInfo(state)) {
      log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size());
      return;
    }

    log.info(String.format("Put destination %s for branch %d", Descriptor.toJson(descriptors), branchId));

    synchronized (state.getProp(getKey(NAME_KEY))) {
      List<Descriptor> resolvedDescriptors = new ArrayList<>();
      for (Descriptor descriptor : descriptors) {
        Descriptor resolvedDescriptor = resolver.resolve(descriptor, state);
        if (resolvedDescriptor == null) {
          continue;
        }
        resolvedDescriptors.add(resolvedDescriptor);
      }

      String destinationKey = getKey(BRANCH, branchId, LineageEventBuilder.DESTINATION);
      String currentDestinations = state.getProp(destinationKey);
      List<Descriptor> allDescriptors = Lists.newArrayList();
      if (StringUtils.isNotEmpty(currentDestinations)) {
        allDescriptors = Descriptor.fromJsonList(currentDestinations);
      }
      allDescriptors.addAll(resolvedDescriptors);

      state.setProp(destinationKey, Descriptor.toJson(allDescriptors));
    }
  }
615002
public void update(int node) {
        final int prev = prev(node);
        final int next = next(node);
        if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) {
            // Update can be done in-place
            copy(node);
            for (int n = node; n != NIL; n = parent(n)) {
                fixAggregates(n);
            }
        } else {
            // TODO: it should be possible to find the new node position without
            // starting from scratch
            remove(node);
            add();
        }
    }
1313827
public void setParent(AstNode parent) {
        if (parent == this.parent) {
            return;
        }

        // Convert position back to absolute.
        if (this.parent != null) {
            setRelative(-this.parent.getAbsolutePosition());
        }

        this.parent = parent;
        if (parent != null) {
            setRelative(parent.getAbsolutePosition());
        }
    }
913815
protected void setState(FieldState state) {
        if (DEBUG)
            LOG.debug("{}:{} --> {}", _state, _field != null ? _field : _headerString != null ? _headerString : _string, state);
        _fieldState = state;
    }