Updates _viewStateCache from the given editor's actual current state
@param {!Editor} editor - editor restore cached data
@private
501677
function _restoreEditorViewState(editor) {
        // We want to ignore the current state of the editor, so don't call __getViewState()
        var viewState = ViewStateManager.getViewState(editor.document.file);
        if (viewState) {
            editor.restoreViewState(viewState);
        }
    }
404628
function( event )
		{
			var keystroke = event && event.data.getKey(),
				isModifierKey = keystroke in modifierKeyCodes,
				isEditingKey = keystroke in editingKeyCodes,
				wasEditingKey = this.lastKeystroke in editingKeyCodes,
				sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke,
				// Keystrokes which navigation through contents.
				isReset = keystroke in navigationKeyCodes,
				wasReset = this.lastKeystroke in navigationKeyCodes,

				// Keystrokes which just introduce new contents.
				isContent = ( !isEditingKey && !isReset ),

				// Create undo snap for every different modifier key.
				modifierSnapshot = ( isEditingKey && !sameAsLastEditingKey ),
				// Create undo snap on the following cases:
				// 1. Just start to type .
				// 2. Typing some content after a modifier.
				// 3. Typing some content after make a visible selection.
				startedTyping = !( isModifierKey || this.typing )
					|| ( isContent && ( wasEditingKey || wasReset ) );

			if ( startedTyping || modifierSnapshot )
			{
				var beforeTypeImage = new Image( this.editor );

				// Use setTimeout, so we give the necessary time to the
				// browser to insert the character into the DOM.
				CKEDITOR.tools.setTimeout( function()
					{
						var currentSnapshot = this.editor.getSnapshot();

						// In IE, we need to remove the expando attributes.
						if ( CKEDITOR.env.ie )
							currentSnapshot = currentSnapshot.replace( /\s+data-cke-expando=".*?"/g, '' );

						if ( beforeTypeImage.contents != currentSnapshot )
						{
							// It's safe to now indicate typing state.
							this.typing = true;

							// This's a special save, with specified snapshot
							// and without auto 'fireChange'.
							if ( !this.save( false, beforeTypeImage, false ) )
								// Drop future snapshots.
								this.snapshots.splice( this.index + 1, this.snapshots.length - this.index - 1 );

							this.hasUndo = true;
							this.hasRedo = false;

							this.typesCount = 1;
							this.modifiersCount = 1;

							this.onChange();
						}
					},
					0, this
				);
			}

			this.lastKeystroke = keystroke;

			// Create undo snap after typed too much (over 25 times).
			if ( isEditingKey )
			{
				this.typesCount = 0;
				this.modifiersCount++;

				if ( this.modifiersCount > 25 )
				{
					this.save( false, null, false );
					this.modifiersCount = 1;
				}
			}
			else if ( !isReset )
			{
				this.modifiersCount = 0;
				this.typesCount++;

				if ( this.typesCount > 25 )
				{
					this.save( false, null, false );
					this.typesCount = 1;
				}
			}

		}
785569
public void update( EditorHost editor )
  {
    _editor = editor;
    _icon.setIcon( findIconForResults() );
    _feedback.repaint();
    repaint();
    editor.repaint();
  }
1168462
function ODataBinding() {
		// maps a canonical path of a quasi-absolute or relative binding to a cache object that may
		// be reused
		this.mCacheByResourcePath = undefined;
		this.oCachePromise = SyncPromise.resolve();
		this.mCacheQueryOptions = undefined;
		// used to create cache only for the latest call to #fetchCache
		this.oFetchCacheCallToken = undefined;
		// change reason to be used when the binding is resumed
		this.sResumeChangeReason = ChangeReason.Change;
	}
73219
function saveBreakHold() {
    if (editor.binding && editor.holding) {
      generator.clientUpdateFragmentText(editor.binding, editor.$edit.val(), true);
      editor.holding = false;
    }
  }
177892
function () {
            var t = this,
                prefix = t.o.prefix;

            if (t.o.autogrowOnEnter) {
                t.autogrowOnEnterDontClose = !t.$box.hasClass(prefix + 'editor-hidden');
            }

            t.semanticCode(false, true);

            setTimeout(function () {
                t.doc.activeElement.blur();
                t.$box.toggleClass(prefix + 'editor-hidden ' + prefix + 'editor-visible');
                t.$btnPane.toggleClass(prefix + 'disable');
                $('.' + prefix + 'viewHTML-button', t.$btnPane).toggleClass(prefix + 'active');
                if (t.$box.hasClass(prefix + 'editor-visible')) {
                    t.$ta.attr('tabindex', -1);
                } else {
                    t.$ta.removeAttr('tabindex');
                }

                if (t.o.autogrowOnEnter && !t.autogrowOnEnterDontClose) {
                    t.autogrowEditorOnEnter();
                }
            }, 0);
        }
963280
function updateImageSizeCSS(editor, model) {
	const pos = editor.getCursorBufferPosition();
	const property = getImageCSSNode(editor, model, pos);
	const urlToken = findUrlToken(property, pos);
	const src = urlToken && getImageSrcCSS(urlToken);

	if (!src) {
		return Promise.reject(new Error('No valid image source'));
	}

	locateFile(editor, src)
	.then(getImageSize)
	.then(size => {
		// since this action is asynchronous, we have to ensure that editor wasn’t
		// changed and user didn’t moved caret outside <img> node
		if (getImageCSSNode(editor, model, pos) === property) {
			updateCSSNode(editor, property, size.width, size.height);
		}
	})
	.catch(err => console.warn('Error while updating image size:', err));
}
1242955
def __Script_Editor_Output_plainTextEdit_set_default_view_state(self):
        

        self.Script_Editor_Output_plainTextEdit.moveCursor(QTextCursor.End)
        self.Script_Editor_Output_plainTextEdit.ensureCursorVisible()
1374608
function refreshButtons(editor) {

    // Webkit requires focus before queryCommandEnabled will return anything but false
    if (!iOS && $.browser.webkit && !editor.focused) {
      editor.$frame[0].contentWindow.focus();
      window.focus();
      editor.focused = true;
    }

    // Get the object used for checking queryCommandEnabled
    var queryObj = editor.doc;
    if (ie) queryObj = getRange(editor);

    // Loop through each button
    var inSourceMode = sourceMode(editor);
    $.each(editor.$toolbar.find("." + BUTTON_CLASS), function(idx, elem) {

      var $elem = $(elem),
        button = $.cleditor.buttons[$.data(elem, BUTTON_NAME)],
        command = button.command,
        enabled = true;

      // Determine the state
      if (editor.disabled)
        enabled = false;
      else if (button.getEnabled) {
        var data = {
          editor: editor,
          button: elem,
          buttonName: button.name,
          popup: popups[button.popupName],
          popupName: button.popupName,
          command: button.command,
          useCSS: editor.options.useCSS
        };
        enabled = button.getEnabled(data);
        if (enabled === undefined)
          enabled = true;
      }
      else if (((inSourceMode || iOS) && button.name != "source") ||
      (ie && (command == "undo" || command == "redo")))
        enabled = false;
      else if (command && command != "print") {
        if (ie && command == "hilitecolor")
          command = "backcolor";
        // IE does not support inserthtml, so it's always enabled
        if (!ie || command != "inserthtml") {
          try {enabled = queryObj.queryCommandEnabled(command);}
          catch (err) {enabled = false;}
        }
      }

      // Enable or disable the button
      if (enabled) {
        $elem.removeClass(DISABLED_CLASS);
        $elem.removeAttr(DISABLED);
      }
      else {
        $elem.addClass(DISABLED_CLASS);
        $elem.attr(DISABLED, DISABLED);
      }

    });
  }
558735
protected void updateAliasEditorStatus(boolean editing) {

        CmsSitemapView.getInstance().getController().getService().updateAliasEditorStatus(
            editing,
            new AsyncCallback<Void>() {

                public void onFailure(Throwable caught) {

                    // do nothing
                }

                public void onSuccess(Void result) {

                    // do nothing
                }

            });
    }
291454
function updateControls(oInPlaceEdit){

			var oContent = oInPlaceEdit.getContent();
			if (!oContent) {
				return;
			}

			var oTooltip = oContent.getTooltip();

			switch (oContent.getMetadata().getName()) { // do not check with instanceof because then all classes must be loaded
			case "sap.ui.commons.TextField":
			case "sap.ui.commons.ComboBox":
			case "sap.ui.commons.DropdownBox":
				// use TextView for display
				if (!oInPlaceEdit._oTextView) {
					oInPlaceEdit._oTextView = new TextView(oInPlaceEdit.getId() + "--TV",{
						wrapping: false});
					oInPlaceEdit._oTextView.setParent(oInPlaceEdit);
					// Make sure the delegate is not there twice
					oInPlaceEdit._oTextView.removeDelegate(contentDelegate);
					oInPlaceEdit._oTextView.addDelegate(contentDelegate, oInPlaceEdit);
					oInPlaceEdit._oTextView.getTooltip = function(){
						return this.getParent().getTooltip();
					};
				}
				oInPlaceEdit._oTextView.setText(oContent.getValue());
				oInPlaceEdit._oTextView.setEnabled(oContent.getEnabled());
				oInPlaceEdit._oTextView.setTextDirection(oContent.getTextDirection());
				oInPlaceEdit._oTextView.setVisible(oContent.getVisible());
				oInPlaceEdit._oTextView.setWidth("100%"); // width is set on the outer DIV
				oInPlaceEdit._oTextView.setTextAlign(oContent.getTextAlign());
				oInPlaceEdit._oTextView.setDesign(oInPlaceEdit.getDesign());
				oInPlaceEdit._oTextView.setHelpId(oContent.getHelpId());
				oInPlaceEdit._oTextView.setAccessibleRole(oContent.getAccessibleRole());

				if (oInPlaceEdit._oTextView._oTooltip && oInPlaceEdit._oTextView._oTooltip != oTooltip) {
					oInPlaceEdit._oTextView.removeDelegate(oInPlaceEdit._oTextView._oTooltip);
					oInPlaceEdit._oTextView._oTooltip = undefined;
				}
				if (oTooltip instanceof sap.ui.core.TooltipBase) {
					if (!oInPlaceEdit._oTextView._oTooltip || oInPlaceEdit._oTextView._oTooltip != oTooltip) {
						oInPlaceEdit._oTextView.addDelegate(oTooltip);
						oInPlaceEdit._oTextView._oTooltip = oTooltip;
					}
				}

				oInPlaceEdit._oDisplayControl = oInPlaceEdit._oTextView;

				// use oContent for edit
				oInPlaceEdit._oEditControl = oContent;
				oInPlaceEdit._bUseEditButton = false;
				break;

			case "sap.ui.commons.Link":
				// use Link for display
				oInPlaceEdit._oDisplayControl = oContent;

				// Make sure the delegate is not there twice
				oInPlaceEdit._oDisplayControl.removeDelegate(contentDelegate);
				oInPlaceEdit._oDisplayControl.addDelegate(contentDelegate, oInPlaceEdit);

				// use TextField for edit
				if (oInPlaceEdit._oTextField) {
					oInPlaceEdit._oTextField.setValue(oContent.getText());
					oInPlaceEdit._oTextField.setWidth("100%");

					oInPlaceEdit._oEditControl = oInPlaceEdit._oTextField;

					if (oInPlaceEdit._oTextField._oTooltip && oInPlaceEdit._oTextField._oTooltip != oTooltip) {
						oInPlaceEdit._oTextField.removeDelegate(oInPlaceEdit._oTextField._oTooltip);
						oInPlaceEdit._oTextField._oTooltip = undefined;
					}
					if (oTooltip instanceof sap.ui.core.TooltipBase) {
						if (!oInPlaceEdit._oTextField._oTooltip || oInPlaceEdit._oTextField._oTooltip != oTooltip) {
							oInPlaceEdit._oTextField.addDelegate(oTooltip);
							oInPlaceEdit._oTextField._oTooltip = oTooltip;
						}
					}
				}

				// for link an edit button is needed to allow the link click
				createEditButton(oInPlaceEdit);
				oInPlaceEdit._bUseEditButton = true;
				break;

			default:
				throw new Error("Control not supported for InPlaceEdit");
			}

		}
70395
function updateCache(dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        if (currDirty) {
            currItemModel = data.getItemModel(dataIndexInside);
            currLabelNormalModel = currItemModel.getModel(LABEL_NORMAL);
            currLabelEmphasisModel = currItemModel.getModel(LABEL_EMPHASIS);
            currVisualColor = data.getItemVisual(dataIndexInside, 'color');

            currDirty = false;
        }
    }
47387
function updateTextArea(editor, checkForChange) {

    var html = $(editor.doc.body).html(),
      options = editor.options,
      updateTextAreaCallback = options.updateTextArea,
      $area = editor.$area;

    // Check for iframe change to avoid unnecessary firing
    // of potentially heavy updateTextArea callbacks.
    if (updateTextAreaCallback) {
      var sum = checksum(html);
      if (checkForChange && editor.frameChecksum == sum)
        return;
      editor.frameChecksum = sum;
    }

    // Convert the iframe html into textarea source code
    var code = updateTextAreaCallback ? updateTextAreaCallback(html) : html;

    // Update the textarea checksum
    if (options.updateFrame)
      editor.areaChecksum = checksum(code);

    // Update the textarea and trigger the change event
    if (code != $area.val()) {
      $area.val(code);
      $(editor).triggerHandler(CHANGE);
    }

  }
537446
function (key, editor) {
        const previousValue = db.get(key);

        return new Promise(function (resolve, reject) {
            // If there is no previous value, then
            // it cannot be frozen, and thus is editable.
            if (!previousValue) {
                resolve(true)
            // Otherwise, if the key is frozen, then only
            // admins can edit the factoid. If the key
            // isn't frozen, it's editable by everybody.
            } else {
                resolve(previousValue.frozen ? isEditorAdmin(editor) : true);
            }
        })
        .then(function (ifCanEdit) {
            return ifCanEdit ? Ok(previousValue) : Fail("frozen");
        });
    }
1097295
def set_current_editor(self, editor, update):
        """"""
        editor_id = editor.get_id()
        if editor_id in list(self.editor_ids.values()):
            item = self.editor_items[editor_id]
            if not self.freeze:
                self.scrollToItem(item)
                self.root_item_selected(item)
                self.__hide_or_show_root_items(item)
            if update:
                self.save_expanded_state()
                tree_cache = self.editor_tree_cache[editor_id]
                self.populate_branch(editor, item, tree_cache)
                self.restore_expanded_state()
        else:
            root_item = FileRootItem(editor.fname, self, editor.is_python())
            root_item.set_text(fullpath=self.show_fullpath)
            tree_cache = self.populate_branch(editor, root_item)
            self.__hide_or_show_root_items(root_item)
            self.root_item_selected(root_item)
            self.editor_items[editor_id] = root_item
            self.editor_tree_cache[editor_id] = tree_cache
            self.resizeColumnToContents(0)
        if editor not in self.editor_ids:
            self.editor_ids[editor] = editor_id
            self.ordered_editor_ids.append(editor_id)
            self.__sort_toplevel_items()
        self.current_editor = editor
634611
public void updateConfig(AddressTemplate addressTemplate, ModelNode currentConfig) {

        String configName = null;
        // update the editor endpoint/client configuration properties
        switch (addressTemplate.getResourceType()) {
            case WebServicesStore.ENDPOINT_CONFIG:
                endpointConfigEditor.updateDetail(currentConfig);
                configName = addressTemplate.getTemplate().substring(addressTemplate.getTemplate().lastIndexOf("=") + 1);
                break;
            case WebServicesStore.CLIENT_CONFIG:
                clientConfigEditor.updateDetail(currentConfig);
                configName = addressTemplate.getTemplate().substring(addressTemplate.getTemplate().lastIndexOf("=") + 1);
                break;
            default:
                // when some handlers actions kicks in, need to strip the pre/post-handlers at the end
                addressTemplate = addressTemplate.subTemplate(2, 3);
                configName = addressTemplate.getTemplate().substring(addressTemplate.getTemplate().lastIndexOf("=") + 1);
                break;
        }

        // update the editor endpoint/client pre/post handlers
        switch (addressTemplate.getResourceType()) {
            case WebServicesStore.ENDPOINT_CONFIG:
                preHandlerEndpointEditor.updateMaster(configName, currentConfig, "pre-handler-chain");
                postHandlerEndpointEditor.updateMaster(configName, currentConfig, "post-handler-chain");
                break;
            case WebServicesStore.CLIENT_CONFIG:
                preHandlerClientEditor.updateMaster(configName, currentConfig, "pre-handler-chain");
                postHandlerClientEditor.updateMaster(configName, currentConfig, "post-handler-chain");
                break;
        }


    }
1297504
function _handleActiveEditorChange(event, current, previous) {
        if (current) { // Handle only full editors
            if (_mrofList.length === 0) {
                _initRecentFilesList();
            }

            var file = current.document.file;
            var paneId = current._paneId;
            _addToMROFList(file, paneId, current.getCursorPos(true, "first"));
        }

        if (previous) { // Capture the last know cursor position
            _updateCursorPosition(previous.document.file.fullPath, previous._paneId, previous.getCursorPos(true, "first"));
        }
    }