Show jobs with `state`.

@param {String} state
@param {Boolean} init
@return {Function}
554233
function show(state) {
    return function () {
        active = state;
        if (pollForJobs.timer) {
            clearTimeout(pollForJobs.timer);
            delete pollForJobs.timer;
        }
        history.pushState({ state: state }, state, state);
        o('#jobs .job').remove();
        o('#menu li a').removeClass('active');
        o('#menu li.' + state + ' a').addClass('active');
        pollForJobs(state, 1000);
        return false;
    }
}
1335701
function initializeState(requester, updateParams) {
        var currentRequester = requester || "";
        _updateParams = updateParams;
        installerPath = path.resolve(updateDir, updateParams.installerName);
        postMessageToBrackets(MessageIds.NOTIFY_INITIALIZATION_COMPLETE, currentRequester);
    }
237867
function ( state ) {
            if ( typeof document.documentElement.onselectstart === 'undefined' ) {
                //FF
                this.selectEnable = function ( state ) {
                    //this.element().style.MozUserSelect = (state)? 'text' : 'none';
                    this.element().onmousedown = (state)? null : function (e) { return false; };
                };
            } else {
                this.selectEnable = function ( state ) {
                    this.element().onselectstart = (state)? null : function (e) { return false; };
                };
            }
            this.selectEnable( state );
        }
927625
function (initFunction) {
        if (_.isFunction(initFunction)) {
            Logger.info("Run init function");
            _customInitFuncton = initFunction;
            return initFunction(appHttp)
                .then(function () {
                    return initFunction(appHttps);
                });
        }
        return Q();
    }
1107631
function initState() {
        var result = $.Deferred();
        updateJsonHandler.parse()
            .done(function() {
                result.resolve();
            })
            .fail(function (code) {
                var logMsg;
                switch (code) {
                case StateHandlerMessages.FILE_NOT_FOUND:
                    logMsg = "AutoUpdate : updateHelper.json cannot be parsed, does not exist";
                    break;
                case StateHandlerMessages.FILE_NOT_READ:
                    logMsg = "AutoUpdate : updateHelper.json could not be read";
                    break;
                case StateHandlerMessages.FILE_PARSE_EXCEPTION:
                    logMsg = "AutoUpdate : updateHelper.json could not be parsed, exception encountered";
                    break;
                case StateHandlerMessages.FILE_READ_FAIL:
                    logMsg = "AutoUpdate : updateHelper.json could not be parsed";
                    break;
                }
                console.log(logMsg);
                result.reject();
            });
        return result.promise();
    }
66133
private String getState(int state)
   {
      String st = "";
      switch (state)
      {

         case BackupJob.FINISHED :
            st = "finished";
            break;

         case BackupJob.WORKING :
            st = "working";
            break;

         case BackupJob.WAITING :
            st = "waiting";
            break;

         case BackupJob.STARTING :
            st = "starting";
            break;
         default :
            break;
      }

      return st;
   }
601895
private void printJobs(ArrayList<JobInProgress> jobsToInitialize) {
    for (JobInProgress job : jobsToInitialize) {
      LOG.info("Passing to Initializer Job Id :" + job.getJobID()
          + " User: " + job.getProfile().getUser() + " Queue : "
          + job.getProfile().getQueueName());
    }
  }
557258
function(options) {
        this._transitions = {}
        this._states = {}
        options = options || {}
        this._bindStates()
        this._bindTransitions()
        if (options.debugStateMachine === true)
          StateMachine.DebugView.register(this)
        this.bind('all', this._onMachineEvent, this)
        this.currentState = INIT_STATE
        this.startStateMachine = function() {
          throw new Error('startStateMachine has been called twice!')
        }
      }
1266464
function(state) {
            this.setState({
                panels: this.state.panels.map(function(panel) {
                    panel.checked = state.index === panel.index
                    return panel
                })
            })
        }
557516
public Object getStateOrCreate(long txid, StateInitializer init) {
        if(_curr.containsKey(txid)) {
            return _curr.get(txid);
        } else {
            getState(txid, init);
            return null;
        }
    }
1039710
function initJobOverview(jobs, cursor) {
  // Empty body.
  var body = $('#running-list > tbody');
  body.empty();

  if (!jobs || (jobs && jobs.length == 0)) {
    $('<td colspan="8">').text('No job records found.').appendTo(body);
    return;
  }

  // Show header.
  $('#running-list > thead').show();

  // Populate the table.
  $.each(jobs, function(index, job) {
    var row = $('<tr id="row-' + job.mapreduce_id + '">');

    var status = (job.active ? 'running' : job.result_status) || 'unknown';
    row.append($('<td class="status-text">').text(status));

    $('<td>').append(
      $('<a>')
        .attr('href', 'detail?mapreduce_id=' + job.mapreduce_id)
        .text('Detail')).appendTo(row);

    row.append($('<td>').text(job.mapreduce_id))
      .append($('<td>').text(job.name));

    var activity = '' + job.active_shards + ' / ' + job.shards + ' shards';
    row.append($('<td>').text(activity))

    row.append($('<td>').text(getIso8601String(job.start_timestamp_ms)));

    row.append($('<td>').text(getElapsedTimeString(
        job.start_timestamp_ms, job.updated_timestamp_ms)));

    // Controller links for abort, cleanup, etc.
    if (job.active) {
      var control = $('<a href="">').text('Abort')
        .click(function(event) {
          abortJob(job.name, job.mapreduce_id);
          event.stopPropagation();
          return false;
        });
      row.append($('<td>').append(control));
    } else {
      var control = $('<a href="">').text('Cleanup')
        .click(function(event) {
          cleanUpJob(job.name, job.mapreduce_id);
          event.stopPropagation();
          return false;
        });
      row.append($('<td>').append(control));
    }
    row.appendTo(body);
  });

  // Set up the next/first page links.
  $('#running-first-page')
    .show()
    .unbind('click')
    .click(function() {
    listJobs(null, initJobOverview);
    return false;
  });
  $('#running-next-page').unbind('click');
  if (cursor) {
    $('#running-next-page')
      .show()
      .click(function() {
        listJobs(cursor, initJobOverview);
        return false;
      });
  } else {
    $('#running-next-page').hide();
  }
  $('#running-list > tfoot').show();
}
656004
function StateManager(options) {
    // Initial state is pending
    this.state = states.pending;

    // If a state is passed in, then we go ahead and initialize the state manager with it
    if (options && options.state) {
      this.transition(options.state, options.value, options.context);
    }
  }
128902
function initializeState() {
        var result = $.Deferred();

        FileSystem.resolve(updateDir, function (err) {
            if (!err) {
                result.resolve();
            } else {
                var directory = FileSystem.getDirectoryForPath(updateDir);
                directory.create(function (error) {
                    if (error) {
                        console.error('AutoUpdate : Error in creating update directory in Appdata');
                        result.reject();
                    } else {
                        result.resolve();
                    }
                });
            }
        });

        return result.promise();
    }
1021751
public void initialize(final S state) {
        final FastMealyState<O> init = this.observationTree.addInitialState();
        this.nodeToObservationMap.put(state, init);
    }
624274
function() {
        if (!this.states) return

        if (!this.states.hasOwnProperty(INIT_STATE))
          this.state(INIT_STATE, {})

        var name, states = this.states
        for (name in states)
          this.state(name, states[name])
      }
371594
function _readyStateChange(state) {
    this.readyState = state;

    if (typeof this.onreadystatechange == "function") {
      this.onreadystatechange(new _Event("readystatechange"));
    }

    this.dispatchEvent(new _Event("readystatechange"));

    if (this.readyState == FakeXMLHttpRequest.DONE) {
      this.dispatchEvent(new _Event("load", false, false, this));
    }
    if (this.readyState == FakeXMLHttpRequest.UNSENT || this.readyState == FakeXMLHttpRequest.DONE) {
      this.dispatchEvent(new _Event("loadend", false, false, this));
    }
  }
1170106
function State(config) {
  this._ = require('lodash');

  this._name = config.name;
  this._isInitial = config.isInitial;
  this._isTerminal = config.isTerminal;
  this._outgoingTransitions = config.outgoingTransitions;

  this.accept = config.accept;

  this._validateConfig(config);

  // Transform any value-based transition criteria to be a function
  this._.forEach(this._outgoingTransitions, function (transition) {
    var criteria = transition.criteria;

    // Replace the value-based criteria with a simple comparison function
    if (typeof criteria !== 'function') {
      transition.criteria = function (input) {
        return (input === criteria);
      }
    }
  });
}