Changes the state of the widget.<p>

@param state the state to change to
343063
void changeState(State state) {

        m_state = state;
        switch (state) {
            case validationRunning:
                m_cancelButton.setEnabled(false);
                m_okButton.setEnabled(false);
                clearValidationError();
                break;
            case validationFailed:
                m_okButton.setEnabled(false);
                m_cancelButton.setEnabled(true);
                break;
            case validationUnknown:
            default:
                m_cancelButton.setEnabled(true);
                m_okButton.setEnabled(true);
                clearValidationError();
                break;

        }
    }
337898
public boolean set(State state) {
    while (true) {
      InternalState internalState = currentInternalState.get();
      checkState(!internalState.isRead, "State was already read, cannot set state.");
      if (state == internalState.state) {
        return false;
      } else {
        if (!currentInternalState.compareAndSet(
            internalState,
            state == State.ENABLED
                ? InternalState.ENABLED_NOT_READ
                : InternalState.DISABLED_NOT_READ)) {
          // The state was changed between the moment the internalState was read and this point.
          // Some conditions may be not correct, reset at the beginning and recheck all conditions.
          continue;
        }
        return true;
      }
    }
  }
1179894
public void setState(State state) {
    this.state = state;
    setText(state.isPrimary() ? text1 : text2);
  }
230105
public void setStateChanges(java.util.Collection<AssessmentRunStateChange> stateChanges) {
        if (stateChanges == null) {
            this.stateChanges = null;
            return;
        }

        this.stateChanges = new java.util.ArrayList<AssessmentRunStateChange>(stateChanges);
    }
292756
public void setState(CmsListState listState) {

        if (!m_metadata.isSelfManaged()) {
            m_filteredItems = null;
        }
        synchronized (this) {
            if (m_visibleItems != null) {
                m_visibleItems.clear();
            }
        }
        setSearchFilter(listState.getFilter());
        setSortedColumn(listState.getColumn());
        if (listState.getOrder() == CmsListOrderEnum.ORDER_DESCENDING) {
            setSortedColumn(listState.getColumn());
        }
        if (listState.getPage() > 0) {
            if (listState.getPage() <= getNumberOfPages()) {
                setCurrentPage(listState.getPage());
            } else {
                setCurrentPage(1);
            }
        }
    }
1339889
public void setSessionState(JingleSessionState stateIs) {

        LOGGER.fine("Session state change: " + sessionState + "->" + stateIs);
        stateIs.enter();
        sessionState = stateIs;
    }
1136130
public void toggle() {
    Command cmd = state.isPrimary() ? command1 : command2;
    setState(state.other());
    cmd.execute();
  }
1052217
public void updateDrawableState(int state, boolean flag) {
        final int oldState = mCombinedState;
        // Update the combined state flag
        if (flag) mCombinedState |= state;
        else mCombinedState &= ~state;

        // Set the combined state
        if (oldState != mCombinedState) {
            setState(VIEW_STATE_SETS[mCombinedState]);
        }
    }
1005346
@Override
    public void updateState(SubscriberState subscriberState) {
        updated.put(subscriberState.getStreamId(), System.currentTimeMillis());
        statusStorageMap.put(subscriberState.getStreamId(), subscriberState);
    }
1170395
@Override
  public void initState(State state) {
    this.state = state;
    // initalize internal windowing state
    super.initState(this.state);
    // initialize user defined state
    if (!this.state.containsKey(USER_STATE)) {
      this.state.put(USER_STATE, new HashMapState<K, V>());
    }
    this.statefulWindowedBolt.initState((State<K, V>) this.state.get(USER_STATE));
  }
766411
@SuppressWarnings({"unchecked", "unused"})
	public void setViewState(MvpViewState<View> viewState) {
		mViewStateAsView = (View) viewState;
		mViewState = (MvpViewState) viewState;
	}
420510
public void toggleState()
    {
        if (m_iCurrentState == ON)
            m_iCurrentState = NULL;
        else if (m_iCurrentState == OFF)
            m_iCurrentState = ON;
        else
            m_iCurrentState = OFF;
        this.updateImage();
    }
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());
            }
        }
    }
977488
public void putViewState(@NonNull String viewId,
      @NonNull Object viewState) {

    if (viewId == null) {
      throw new NullPointerException("ViewId is null");
    }

    if (viewState == null) {
      throw new NullPointerException("ViewState is null");
    }

    PresenterHolder presenterHolder = presenterMap.get(viewId);
    if (presenterHolder == null) {
      presenterHolder = new PresenterHolder();
      presenterHolder.viewState = viewState;
      presenterMap.put(viewId, presenterHolder);
    } else {
      presenterHolder.viewState = viewState;
    }
  }
554439
private void setState(final EvaluatorState toState) {
    while (true) {

      final EvaluatorState fromState = this.state.get();
      if (fromState == toState) {
        break;
      }

      if (!fromState.isLegalTransition(toState)) {
        LOG.log(Level.WARNING, "Illegal state transition: {0} -> {1}", new Object[] {fromState, toState});
        throw new IllegalStateException("Illegal state transition: " + fromState + " -> " + toState);
      }

      if (this.state.compareAndSet(fromState, toState)) {
        break;
      }
    }
  }
1075704
@Override
    public void setState(MotorState state) {

        switch(state) {
            case STOP: {
                // set internal tracking state
                currentState = MotorState.STOP;

                // turn all GPIO pins to OFF state
                for(GpioPinDigitalOutput pin : pins)
                    pin.setState(offState);

                break;
            }
            case FORWARD: {
                // set internal tracking state
                currentState = MotorState.FORWARD;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            case REVERSE: {
                // set internal tracking state
                currentState = MotorState.REVERSE;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            default: {
                throw new UnsupportedOperationException("Cannot set motor state: " + state.toString());
            }
        }
    }
1039049
public void setToggleStates(Map toggleStates) {
        // We are providing a toggleStates map - so by definition we must want to
        // store the toggle states
        setRestoreToggleStates(true);
        this.toggleStates.clear();
        this.toggleStates.putAll(toggleStates);
    }