Restore state associated with the window manager
@param state
164072
@SuppressWarnings("unchecked")
  public void restoreState(Map<String, Serializable> state) {
    LOG.info("Restoring window manager state");

    //restore eviction policy state
    if (state.get(EVICTION_STATE_KEY) != null) {
      ((EvictionPolicy) evictionPolicy).restoreState(state.get(EVICTION_STATE_KEY));
    }

    // restore trigger policy state
    if (state.get(TRIGGER_STATE_KEY) != null) {
      ((TriggerPolicy) triggerPolicy).restoreState(state.get(TRIGGER_STATE_KEY));
    }

    // restore all pending events to the queue
    this.queue.addAll((Collection<Event<T>>) state.get(QUEUE));

    // restore all expired events
    this.expiredEvents.addAll((List<T>) state.get(EXPIRED_EVENTS));

    // restore all prevWindowEvents
    this.prevWindowEvents.addAll((Set<Event<T>>) state.get(PRE_WINDOW_EVENTS));

    // restore the count of the number events since last expiry
    this.eventsSinceLastExpiry.set((int) state.get(EVENTS_SINCE_LAST_EXPIRY));
  }
43946
private void restoreData() {
		Map<String, ?> map = preferenceUtils.getAll();
		Set<String> strings = map.keySet();

		for (String string : strings) {
			if (string.startsWith(SharedPreferenceUtils.keyTestMode)) {
				preferenceUtils.restoreKey(string);
			}
		}

		refreshKeyValues();

	}
98562
def restore(self, state):
        

        reading = state.get(u'reading')
        if reading is not None:
            reading = IOTileReading.FromDict(reading)

        selector = DataStreamSelector.FromString(state.get(u'selector'))
        if self.selector != selector:
            raise ArgumentError("Attempted to restore a VirtualStreamWalker with a different selector",
                                selector=self.selector, serialized_data=state)

        self.reading = reading
702185
void setUndoRedoState(UndoRedoState state) {

        if (state.hasUndo()) {
            m_undoButton.enable();
        } else {
            m_undoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_UNDO_DISABLED_0));
        }
        if (state.hasRedo()) {
            m_redoButton.enable();
        } else {
            m_redoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_REDO_DISABLED_0));
        }
    }
1092224
protected void restore(BaseState state) {
    if (state.buffer != null) {
      this.buffer = state.buffer.clone();
      this.limit = state.buffer.length;
    }
    this.position = state.position;
    this.isOpen = state.isOpen;
    this.chunkSize = state.chunkSize;
  }
1055655
final void restoreState(final Persistable tuple) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "restoreState", tuple);

        PersistentTranId xid = tuple.getPersistentTranId();
        boolean logicallyDeleted = tuple.isLogicallyDeleted();
        PersistentTransaction transaction = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(this, tc, "xid = " + xid + "; logicallyDeleted = " + logicallyDeleted);

        if (xid != null)
        {
            transaction = getMessageStoreImpl().getXidManager().getTransactionFromTranId(xid);
        }
        if (null == transaction)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "no transaction so tuple is not in doubt ");

            // We get here if transaction is null - either XID is null (a rolled
            // back transaction has reset the row to its original state) or XID
            // is not null, but no transaction was found (a completed transaction)
            if (logicallyDeleted)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is logically deleted - removing link");
            }
            else
            {
                boolean canExpireSilently = false /* tuple.canExpireSilently() */;
                boolean expired = false /* tuple.isExpired() */;
                if (expired && canExpireSilently)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is expired and can expire silently - removing link");
                }
                else
                {
                    // The itemLink is AVAILABLE or LOCKED
                    long lockID = tuple.getLockID();
                    if (AbstractItem.NO_LOCK_ID != lockID)
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "tuple is locked. LockID = " + lockID);

                        _restoreStatePersistentlyLocked(this, _owningStreamLink, lockID);
                        _owningStreamLink.append(this);
                    }
                    else
                    {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "tuple is not locked");

                        /*
                         * If the deliverydelaytime is greater than the current time during reconstitution then
                         * the item has to be added as locked.And it must be locked using DELIVERY_DELAY_LOCK_ID
                         * lock ID
                         * In the other case we just add the item as available so that it is available for
                         * consumption
                         */
                        if (tuple.getDeliveryDelayTime() > System.currentTimeMillis()) {
                            _restoreStateLocked(this, _owningStreamLink, Item.DELIVERY_DELAY_LOCK_ID);
                            // Register with the DeliveryDelayManager
                            registerWithDeliveryDelayManager();
                        }
                        else {
                            _restoreStateAvailable(this, _owningStreamLink);
                        }
                        _owningStreamLink.append(this);
                    }
                    //Only register with expirer when we are in available or locked state. The other
                    // states will register when either the commit call comes in, or don't require
                    // expiry as the item is already deleted.
                    registerWithExpirer();

                }
            }
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Tuple is in doubt. transaction = " + transaction);

            Task task = null;
            if (logicallyDeleted)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is logically deleted - tuple is deleting");

                //Instantiate the itemLink as REMOVING
                long lockID = tuple.getLockID();
                if (AbstractItem.NO_LOCK_ID != lockID)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is 'removingLocked'. lockID = " + lockID);

                    _restoreStateRemovingPersistentlyLocked(this, _owningStreamLink, getLockID(), transaction);
                    _owningStreamLink.append(this);
                    task = new RemoveLockedTask(this);
                    //D184032
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "tuple is not locked");

                    _restoreStateRemovingNoLock(this, _owningStreamLink, transaction);
                    _owningStreamLink.append(this);
                    task = new RemoveTask(this);
                    //D184032
                }
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "tuple is not logicallyDeleted, so is adding");

                /*
                 * If the deliverydelaytime is greater than the current time during reconstitution then
                 * the item has to be added as locked.And it must be locked using DELIVERY_DELAY_LOCK_ID
                 * lock ID
                 * In the other case we just add the item as available so that it is available for
                 * consumption
                 */
                if (tuple.getDeliveryDelayTime() > System.currentTimeMillis()) {
                    _restoreStateLocked(this, _owningStreamLink, Item.DELIVERY_DELAY_LOCK_ID);
                    //Not adding to deliverydelay manager here because it will be done in AddTask.commitExternal
                } else {
                    //Instantiate the itemLink as ADDING
                    _restoreStateAdding(this, _owningStreamLink, transaction);
                }
                _owningStreamLink.append(this);
                task = new AddTask(this);
                //D184032
            }
            try
            {
                transaction.addWork(task);
                ((TaskList) transaction.getWorkList()).declareAlreadyPrecommitted();
            } catch (MessageStoreException e)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.restoreState", "1:3526:1.241", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "Exception " + e + " while adding task to tasklist");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(this, tc, "restoreState");
                throw new SevereMessageStoreException("SIMS_NNNN", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "restoreState");
    }
202912
@Override
    public void onRestoreInstanceState(Parcelable state) {

        if (state instanceof Bundle) {
            Bundle bundle = (Bundle) state;
            //load everything
            PinViewSettings pinViewSettings = bundle.getParcelable("stateSettings");
            if (pinViewSettings != null) {
                setSettings(pinViewSettings);
            }
            String pinResults = bundle.getString("statePinResults");
            setPinResults(pinResults);
            state = bundle.getParcelable("instanceState");
        }
        super.onRestoreInstanceState(state);
    }
174865
def restore(self, state):
        
        self._clear()
        self._parseUserInfo({'labels': state['labels']})
        self._parseNodes(state['nodes'])
        self._keep_version = state['keep_version']
1102229
def restore_state(self, state):
        

        super(ReferenceController, self).restore_state(state)

        state_name = state.get('state_name')
        state_version = state.get('state_version')

        if state_name != self.STATE_NAME or state_version != self.STATE_VERSION:
            raise ArgumentError("Invalid emulated device state name or version", found=(state_name, state_version),
                                expected=(self.STATE_NAME, self.STATE_VERSION))

        self.app_info = state.get('app_info', (0, "0.0"))
        self.os_info = state.get('os_info', (0, "0.0"))

        # Notify all subsystems of our intent to restore in case they need to prepare
        self.sensor_log.prepare_for_restore()

        # Restore all of the subsystems
        self.remote_bridge.restore(state.get('remote_bridge', {}))
        self.tile_manager.restore(state.get('tile_manager', {}))
        self.config_database.restore(state.get('config_database', {}))
        self.sensor_log.restore(state.get('sensor_log', {}))
443104
def restore(self, state):
        '''

        '''
        self.a = np.array(state['a']).copy()
        self.b = np.array(state['b']).copy()
        self.c = np.array(state['c']).copy()
        self.pivot = np.array(state['pivot']).copy()
        self.position = np.array(state['position']).copy()
180890
public void changeCurrentAppState(String state) {

        String completeState = m_navigationStateManager.getState();
        String view = getViewName(completeState);
        String newCompleteState = view;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(state)) {
            newCompleteState += NavigationState.PARAM_SEPARATOR + state;
        }
        m_navigationStateManager.setState(newCompleteState);

    }
1016421
public static WindowState getWindowState(String state) {
        if (state == null) {
            return null;
        }

        final WindowState windowState = WINDOW_STATES.get(state);
        if (windowState != null) {
            return windowState;
        }

        return new WindowState(state);
    }
206057
@Override public void onRestoreInstanceState(Parcelable state) {
    if (isInEditMode) return;

    if (!(state instanceof MosbyViewStateSavedState)) {
      delegateCallback.superOnRestoreInstanceState(state);
      return;
    }

    MosbyViewStateSavedState savedState = (MosbyViewStateSavedState) state;
    mosbyViewId = savedState.getMosbyViewId();
    restoreableParcelableViewState = (VS) savedState.getRestoreableViewState();
    delegateCallback.superOnRestoreInstanceState(savedState.getSuperState());
  }
948544
def resetState(self):
        
        self.extend(self._hidden)
        del self._hidden[:]
        del self._states[:]
741311
@SuppressWarnings("unchecked")
    public void restoreState(FacesContext context, Object state) {

        if (context == null) {
            throw new NullPointerException();
        }

        if (state != null) {

            // Unchecked cast from Object to List<BehaviorListener>
            listeners = (List<BehaviorListener>)UIComponentBase.restoreAttachedState(context, state);

            // If we saved state last time, save state again next time.
            clearInitialState();
        }
    }
1035224
function restore_allstate(res)
{
    if (gli_windowlist || gli_streamlist || gli_filereflist)
        throw('restore_allstate: glkapi module has already been launched');

    /* We build and register all the bare objects first. (In reverse
       order so that the linked lists come out right way around.) */

    for (var ix=res.windows.length-1; ix>=0; ix--) {
        var obj = res.windows[ix];
        var win = {
            type: obj.type, rock: obj.rock, disprock: obj.disprock,
            style: obj.style, hyperlink: obj.hyperlink
        };
        GiDispa.class_register('window', win, win.disprock);

        win.prev = null;
        win.next = gli_windowlist;
        gli_windowlist = win;
        if (win.next)
            win.next.prev = win;
    }

    for (var ix=res.streams.length-1; ix>=0; ix--) {
        var obj = res.streams[ix];
        var str = {
            type: obj.type, rock: obj.rock, disprock: obj.disprock,
            unicode: obj.unicode, isbinary: obj.isbinary,
            readcount: obj.readcount, writecount: obj.writecount,
            readable: obj.readable, writable: obj.writable,
            streaming: obj.streaming
        };
        GiDispa.class_register('stream', str, str.disprock);

        str.prev = null;
        str.next = gli_streamlist;
        gli_streamlist = str;
        if (str.next)
            str.next.prev = str;
    }

    for (var ix=res.filerefs.length-1; ix>=0; ix--) {
        var obj = res.filerefs[ix];
        var fref = {
            type: obj.type, rock: obj.rock, disprock: obj.disprock,
            filename: obj.filename, textmode: obj.textmode,
            filetype: obj.filetype, filetypename: obj.filetypename
        };
        GiDispa.class_register('fileref', fref, fref.disprock);

        fref.prev = null;
        fref.next = gli_filereflist;
        gli_filereflist = fref;
        if (fref.next)
            fref.next.prev = fref;
    }

    /* ...Now we fill in the cross-references. */

    for (var ix=0; ix<res.windows.length; ix++) {
        var obj = res.windows[ix];
        var win = GiDispa.class_obj_from_id('window', obj.disprock);

        win.parent = GiDispa.class_obj_from_id('window', obj.parent);
        win.str = GiDispa.class_obj_from_id('stream', obj.str);
        win.echostr = GiDispa.class_obj_from_id('stream', obj.echostr);

        win.bbox = { 
            left: obj.bbox.left, right: obj.bbox.right,
            top: obj.bbox.top, bottom: obj.bbox.bottom 
        };

        win.input_generation = null;
        if (obj.char_request || obj.line_request)
            win.input_generation = event_generation;
        win.linebuf = null;
        if (obj.linebuf !== undefined) {
            // should clone that object
            win.linebuf = obj.linebuf.arr;
            GiDispa.retain_array(win.linebuf, obj.linebuf);
        }
        win.char_request = obj.char_request;
        win.line_request = obj.line_request;
        win.char_request_uni = obj.char_request_uni;
        win.line_request_uni = obj.line_request_uni;
        win.hyperlink_request = obj.hyperlink_request;
        win.mouse_request = obj.mouse_request;
        win.echo_line_input = obj.echo_line_input;
        win.request_echo_line_input = obj.request_echo_line_input;
        win.line_input_terminators = obj.line_input_terminators.slice(0);
        //### should have a request_line_input_terminators as well

        switch (win.type) {
        case Const.wintype_TextBuffer:
            win.accum = [];
            win.accumstyle = win.style;
            win.accumhyperlink = win.hyperlink;
            win.content = obj.reserve.slice(0);
            win.clearcontent = false;
            win.reserve = [];
            break;
        case Const.wintype_TextGrid:
            win.gridwidth = obj.gridwidth;
            win.gridheight = obj.gridheight;
            win.lines = [];
            for (var jx=0; jx<obj.lines.length; jx++) {
                var ln = obj.lines[jx];
                win.lines.push({
                        dirty: true,
                        chars: ln.chars.slice(0),
                        styles: ln.styles.slice(0),
                        hyperlinks: ln.hyperlinks.slice(0)
                    });
            }
            win.cursorx = obj.cursorx;
            win.cursory = obj.cursory;
            break;
        case Const.wintype_Graphics:
            win.graphwidth = obj.graphwidth;
            win.graphheight = obj.graphheight;
            win.content = obj.reserve.slice(0);
            win.reserve = [];
            break;
        case Const.wintype_Pair:
            win.pair_dir = obj.pair_dir;
            win.pair_division = obj.pair_division;
            win.pair_key = GiDispa.class_obj_from_id('window', obj.pair_key);
            win.pair_keydamage = false;
            win.pair_size = obj.pair_size;
            win.pair_hasborder = obj.pair_hasborder;
            win.pair_vertical = obj.pair_vertical;
            win.pair_backward = obj.pair_backward;
            win.child1 = GiDispa.class_obj_from_id('window', obj.child1);
            win.child2 = GiDispa.class_obj_from_id('window', obj.child2);
            break;
        }
    }

    for (var ix=0; ix<res.streams.length; ix++) {
        var obj = res.streams[ix];
        var str = GiDispa.class_obj_from_id('stream', obj.disprock);

        /* Defaults first... */
        str.win = null;
        str.ref = null;
        str.file = null;

        str.buf = null;
        str.bufpos = 0;
        str.buflen = 0;
        str.bufeof = 0;
        str.timer_id = null;
        str.flush_func = null;
        str.fstream = null;

        switch (str.type) {

        case strtype_Window:
            str.win = GiDispa.class_obj_from_id('window', obj.win);
            break;

        case strtype_Memory:
            if (obj.buf !== undefined) {
                // should clone that object
                str.buf = obj.buf.arr;
                GiDispa.retain_array(str.buf, obj.buf);
            }
            str.buflen = obj.buflen;
            str.bufpos = obj.bufpos;
            str.bufeof = obj.bufeof;
            break;

        case strtype_Resource:
            str.resfilenum = obj.resfilenum;
            var el = GiLoad.find_data_chunk(str.resfilenum);
            if (el) {
                str.buf = el.data;
            }
            str.buflen = obj.buflen;
            str.bufpos = obj.bufpos;
            str.bufeof = obj.bufeof;
            break;

        case strtype_File:
            str.origfmode = obj.origfmode;
            if (!Dialog.streaming) {
                str.ref = obj.ref;
                str.buflen = obj.buflen;
                str.bufpos = obj.bufpos;
                str.bufeof = obj.bufeof;

                var content = Dialog.file_read(str.ref);
                if (content == null) {
                    /* The file was somehow deleted. Create an empty
                       file (even in read mode). */
                    content = [];
                    Dialog.file_write(str.ref, '', true);
                }
                str.buf = content;

                /* If the file has been shortened, we might have to
                   trim bufeof to fit within it. The game might see
                   the file pos mysteriously move; sorry. */
                str.bufeof = content.length;
                if (str.bufpos > str.bufeof)
                    str.bufpos = str.bufeof;
            }
            else {
                str.ref = obj.ref;
                str.fstream = Dialog.file_fopen(str.origfmode, str.ref);
                if (!str.fstream) {
                    /* This is the panic case. We can't reopen the stream,
                       but the game expects an open stream! We'll just
                       have to open a temporary file; the user will never
                       get their data, but at least the game won't crash.
                       (Better policy would be to prompt the user for
                       a new file location...) */
                    var tempref = Dialog.file_construct_temp_ref(str.ref.usage);
                    str.fstream = Dialog.file_fopen(str.origfmode, tempref);
                    if (!str.fstream)
                        throw('restore_allstate: could not reopen even a temp stream for: ' + str.ref.filename);
                }

                if (str.origfmode != Const.filemode_WriteAppend) {
                    /* Jump to the last known filepos. */
                    str.fstream.fseek(obj.filepos, Const.seekmode_Start);
                }

                str.buffer4 = new str.fstream.BufferClass(4);
            }
            break;

        }
    }

    for (var ix=0; ix<res.filerefs.length; ix++) {
        var obj = res.filerefs[ix];
        var fref = GiDispa.class_obj_from_id('fileref', obj.disprock);

        fref.ref = obj.ref; // should deep clone
    }

    gli_rootwin = GiDispa.class_obj_from_id('window', res.rootwin);
    gli_currentstr = GiDispa.class_obj_from_id('stream', res.currentstr);

    if (res.timer_interval)
        glk_request_timer_events(res.timer_interval);

    /* Stash this for the next (first) GlkOte.update call. */
    gli_autorestore_glkstate = res.glkote;
}
1305220
public void restore() {

        if (!restored) {

            // Remove the extra Handler from the RootLogger
            rootLogger.removeHandler(mavenLogHandler);

            // Restore the original state to the Root logger
            rootLogger.setLevel(originalRootLoggerLevel);
            for (Handler current : originalHandlers) {
                rootLogger.addHandler(current);
            }

            // All done.
            restored = true;
        }
    }