Changes the editor on the fly

@param string $editor String name of editor, excluding the word 'Helper'
@param array $helperOptions Each type of wysiwyg helper takes different options.
@return void
@throws MissingHelperException
517880
public function changeEditor($editor, $helperOptions = array()) {
		$this->helper = ucfirst($editor);

		if (!empty($helperOptions)) {
			$this->updateSettings($helperOptions);
		}

		if (!isset($this->importedHelpers[$this->helper])) {
			throw new MissingHelperException(sprintf("Missing Wysiwyg.%s Helper", $this->helper));
		}

		if (!$this->importedHelpers[$this->helper]) {
			$class = 'Wysiwyg.' . $this->helper;
			$helpers = ObjectCollection::normalizeObjectArray(array($class));
			foreach ($helpers as $properties) {
				list($plugin, $class) = pluginSplit($properties['class']);
				$this->{$class} = $this->_View->Helpers->load($properties['class'], $properties['settings']);
			}

			$this->importedHelpers[$this->helper] = true;
		}
	}
892560
protected static function editorLink($source)
    {
        if (is_string($source) === true) {
            $file = $source;
            $line = null;
        } else {
            $file = $source[0];
            $line = $source[1];
        }

        return Helpers::editorLink($file, $line);
    }
1206108
public function addOption($option)
    {
        if (in_array($option, Generator::$tagOptionKeys)
            && !$this->hasOption($option)
        ) {
            $this->options[] = $option;
        }
    }
556895
function(editor, openWindowFn) {
  this.editor = editor;
  this.openWindowFn = openWindowFn;
  this.supportedEditors = this._getSupportedEditors();
  if (this.editor && !this._isSupportedEditor(this.editor)) {
    throw new Error(this.editor+' was not found in list of supported editors. Please check your global settings to ensure the self.editor path for '+this.editor+' is configured correctly.');
  }
}
1200946
function html_editor($args)
    {
        $rcube = rcube::get_instance();

        $this->load_config();

        if ($rcube->config->get('emoticons_compose', true)) {
            $args['extra_plugins'][] = 'emoticons';
            $args['extra_buttons'][] = 'emoticons';
        }

        return $args;
    }
231174
function(self, options) {

    self.options = options;
    self.editorName = self.name + '-widgets-editor';

    // Opens the editor modal of a widget, unless the widget is contextualOnly,
    // in which case we simply save the widget and call the save method
    // Widget can opitonally be set to skipInitialModal which skips the first
    // edit modal but binds future editing interactions

    self.edit = function(data, options, save) {
      if (!data) {
        data = {};
      }
      if (!data._id) {
        _.assign(data, apos.schemas.newInstance(self.schema));
      }

      // Only create a modal editor if the schema is not contextual only
      if (self.options.contextualOnly) {

        return save(checkOrGenerateId(data), function() {});

      } else {

        if (self.options.skipInitialModal && (!data || !data._id)) {
          return save(checkOrGenerateId(data), function() {});

        }

        apos.create(self.editorName, {
          label: self.label,
          action: self.options.action,
          schema: self.options.schema,
          data: data,
          templateOptions: options,
          save: save,
          module: self
        });
      }

      // Checks for an id or assign a generated one
      function checkOrGenerateId (data) {
        data = data || {};
        if (!data._id) {
          data._id = apos.utils.generateId();
        }
        return data;
      }

    };

    // Area editor calls this to determine whether to apply an empty state
    // class for the widget
    self.isEmpty = function($widget) {
      return false;
    };

    var superGetData = self.getData;
    self.getData = function($widget) {
      var data = superGetData($widget);
      // If the field is contextual and its type has a `contextualConvert`
      // function, we need to run that when retrieving the widget's data.
      // Or, if the field has a `contextualIsPresent` method, we can use that
      // to check whether an editor is actually present for it, bypassing the
      // need to restrict this feature solely to fields marked contextual
      // in the schema.
      _.each(self.schema, function(field) {
        var type = apos.schemas.fieldTypes[field.type];
        if (
          (type.contextualIsPresent && type.contextualIsPresent($widget, field) && type.contextualConvert) ||
          (field.contextual && type.contextualConvert)
        ) {
          apos.schemas.fieldTypes[field.type].contextualConvert(data, field.name, $widget, field);
        }
      });
      return data;
    };

    // Start autosaving the area containing the given widget,
    // then invoke the given function. On failure fn is not invoked.
    // Invoked by widgets that are edited contextually on the page,
    // like apostrophe-rich-text, as opposed to widgets edited
    // via a modal.

    self.startAutosavingAreaThen = function($widget, fn) {
      var $area = $widget.closest('[data-apos-area]');
      return $area.data('editor').startAutosavingThen(fn);
    };
  }
1282579
def set_editor(self, editor):
        
        try:
            self._editor.cursorPositionChanged.disconnect(self.sync)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        try:
            self._outline_mode.document_changed.disconnect(
                self._on_changed)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        try:
            self._folding_panel.trigger_state_changed.disconnect(
                self._on_block_state_changed)
        except (AttributeError, TypeError, RuntimeError, ReferenceError):
            pass
        if editor:
            self._editor = weakref.proxy(editor)
        else:
            self._editor = None

        if editor is not None:
            editor.cursorPositionChanged.connect(self.sync)
            try:
                self._folding_panel = weakref.proxy(
                    editor.panels.get(FoldingPanel))
            except KeyError:
                pass
            else:
                self._folding_panel.trigger_state_changed.connect(
                    self._on_block_state_changed)
            try:
                analyser = editor.modes.get(OutlineMode)
            except KeyError:
                self._outline_mode = None
            else:
                self._outline_mode = weakref.proxy(analyser)
                analyser.document_changed.connect(self._on_changed)
        self._on_changed()
984173
public void setEditor(JsGeometryEditor editor) {
		delegate = new ShowSplitAreas(editor.getMap().getMapWidget(), editor.getSplitService().getDelegate());
	}
1239764
function( editor ) {
			var genericDefinition = CKEDITOR.plugins.indent.genericDefinition;

			// Register generic commands.
			setupGenericListeners( editor, editor.addCommand( 'indent', new genericDefinition( true ) ) );
			setupGenericListeners( editor, editor.addCommand( 'outdent', new genericDefinition() ) );

			// Create and register toolbar button if possible.
			if ( editor.ui.addButton ) {
				editor.ui.addButton( 'Indent', {
					label: editor.lang.indent.indent,
					command: 'indent',
					directional: true,
					toolbar: 'indent,20'
				} );

				editor.ui.addButton( 'Outdent', {
					label: editor.lang.indent.outdent,
					command: 'outdent',
					directional: true,
					toolbar: 'indent,10'
				} );
			}

			// Register dirChanged listener.
			editor.on( 'dirChanged', function( evt ) {
				var range = editor.createRange(),
					dataNode = evt.data.node;

				range.setStartBefore( dataNode );
				range.setEndAfter( dataNode );

				var walker = new CKEDITOR.dom.walker( range ),
					node;

				while ( ( node = walker.next() ) ) {
					if ( node.type == CKEDITOR.NODE_ELEMENT ) {
						// A child with the defined dir is to be ignored.
						if ( !node.equals( dataNode ) && node.getDirection() ) {
							range.setStartAfter( node );
							walker = new CKEDITOR.dom.walker( range );
							continue;
						}

						// Switch alignment classes.
						var classes = editor.config.indentClasses;
						if ( classes ) {
							var suffix = ( evt.data.dir == 'ltr' ) ? [ '_rtl', '' ] : [ '', '_rtl' ];
							for ( var i = 0; i < classes.length; i++ ) {
								if ( node.hasClass( classes[ i ] + suffix[ 0 ] ) ) {
									node.removeClass( classes[ i ] + suffix[ 0 ] );
									node.addClass( classes[ i ] + suffix[ 1 ] );
								}
							}
						}

						// Switch the margins.
						var marginLeft = node.getStyle( 'margin-right' ),
							marginRight = node.getStyle( 'margin-left' );

						marginLeft ? node.setStyle( 'margin-left', marginLeft ) : node.removeStyle( 'margin-left' );
						marginRight ? node.setStyle( 'margin-right', marginRight ) : node.removeStyle( 'margin-right' );
					}
				}
			} );
		}
989995
public function edit() {
		$config_path = $this->get_config_path();
		$contents    = file_get_contents( $config_path );
		$r           = Utils\launch_editor_for_input( $contents, 'wp-config.php', 'php' );
		if ( false === $r ) {
			WP_CLI::warning( 'No changes made to wp-config.php.', 'Aborted' );
		} else {
			file_put_contents( $config_path, $r );
		}
	}
1164855
private function add_helpers( $helpers ) {
		foreach( $helpers as $helper ) {
			$helper = $this->validate_helper_input( $helper );
			if ( is_array( $helper ) ) {
				$this->add_helper( $helper );
			}

		}

	}
1061123
public function editorOptions()
    {
        if ($this->editorOptions === null) {
            $this->editorOptions = $this->defaultEditorOptions();
        }

        return $this->editorOptions;
    }
1265436
function editorUpdate() {
    if (editor.binding) {
      if ('hold' === generator.clientUpdateFragmentText(editor.binding, editor.$edit.val())) {
        editor.holding = true;
      }
    }
  }
1029424
public void updateEditorMode() {

        CmsClientSitemapEntry entry = getSitemapEntry();
        getListItemWidget().setIcon(CmsSitemapView.getInstance().getIconForEntry(entry));
        setAdditionalStyles(entry, getListItemWidget());
        for (Widget child : m_children) {
            if (child instanceof CmsSitemapTreeItem) {
                ((CmsSitemapTreeItem)child).updateEditorMode();
            }
        }
    }
526269
protected void editSRE() {
		final IStructuredSelection selection = (IStructuredSelection) this.sresList.getSelection();
		final ISREInstall sre = (ISREInstall) selection.getFirstElement();
		if (sre == null) {
			return;
		}
		final EditSREInstallWizard wizard = new EditSREInstallWizard(
				sre, this.sreArray.toArray(new ISREInstall[this.sreArray.size()]));
		final WizardDialog dialog = new WizardDialog(getShell(), wizard);
		if (dialog.open() == Window.OK) {
			this.sresList.setSelection(new StructuredSelection(sre));
			this.sresList.refresh(true);
			updateUI();
		}
	}
1131240
public function setOptions(array $options = []): void
    {
        $this->options = $this->shortcuts = [];
        $this->addOptions($options);
    }
736959
public function addOption($option)
    {
        $options = $this->getOptions();
        array_push($options, $option);
        $this->setOptions($options);
    }