How to use the @jupyterlab/codeeditor.CodeEditorWrapper function in @jupyterlab/codeeditor

To help you get started, we’ve selected a few @jupyterlab/codeeditor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / tests / test-completer / src / widget.spec.ts View on Github external
function createEditorWidget(): CodeEditorWrapper {
  let model = new CodeEditor.Model();
  let factory = (options: CodeEditor.IOptions) => {
    return new CodeMirrorEditor(options);
  };
  return new CodeEditorWrapper({ factory, model });
}
github jupyterlab / jupyterlab-data-explorer / tests / test-completer / src / handler.spec.ts View on Github external
function createEditorWidget(): CodeEditorWrapper {
  const model = new CodeEditor.Model();
  const factory = (options: CodeEditor.IOptions) => {
    return new CodeMirrorEditor(options);
  };
  return new CodeEditorWrapper({ factory, model });
}
github jupyterlab / jupyterlab / testutils / src / notebook-utils.ts View on Github external
export function createCellEditor(model?: CodeCellModel): CodeEditorWrapper {
    return new CodeEditorWrapper({
      model: model || new CodeCellModel({}),
      factory: editorFactory
    });
  }
github jupyterlab / jupyterlab / tests / test-completer / src / handler.spec.ts View on Github external
function createEditorWidget(): CodeEditorWrapper {
  const model = new CodeEditor.Model();
  const factory = (options: CodeEditor.IOptions) => {
    return new CodeMirrorEditor(options);
  };
  return new CodeEditorWrapper({ factory, model });
}
github jupyterlab / jupyterlab / tests / test-completer / src / widget.spec.ts View on Github external
function createEditorWidget(): CodeEditorWrapper {
  let model = new CodeEditor.Model();
  let factory = (options: CodeEditor.IOptions) => {
    return new CodeMirrorEditor(options);
  };
  return new CodeEditorWrapper({ factory, model });
}
github jupyterlab / jupyterlab-data-explorer / tests / test-completer / src / widget.spec.ts View on Github external
function createEditorWidget(): CodeEditorWrapper {
  let model = new CodeEditor.Model();
  let factory = (options: CodeEditor.IOptions) => {
    return new CodeMirrorEditor(options);
  };
  return new CodeEditorWrapper({ factory, model });
}
github jupyterlab / jupyterlab / packages / notebook / src / notebooktools.ts View on Github external
let cellLoc = (this._cellModel = activeCell.editor.model);
      this._valueListener = DatastoreExt.listenField(
        { ...cellLoc.record, field: 'text' },
        this._onValueChanged,
        this
      );
      this._mimeTypeListener = DatastoreExt.listenField(
        { ...cellLoc.record, field: 'mimeType' },
        this._onMimeTypeChanged,
        this
      );
      this._model.value = activeCell.editor.model.value.split('\n')[0];
      this._model.mimeType = activeCell.editor.model.mimeType;

      let model = this._model;
      let editorWidget = new CodeEditorWrapper({ model, factory });
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.editor.setOption('readOnly', true);
      layout.addWidget(prompt);
      layout.addWidget(editorWidget);
    }
github jupyterlab / jupyterlab-data-explorer / packages / notebook / src / notebooktools.ts View on Github external
return;
      }
      let promptNode = activeCell.promptNode
        ? (activeCell.promptNode.cloneNode(true) as HTMLElement)
        : null;
      let prompt = new Widget({ node: promptNode });
      let factory = activeCell.contentFactory.editorFactory;

      let cellModel = (this._cellModel = activeCell.model);
      cellModel.value.changed.connect(this._onValueChanged, this);
      cellModel.mimeTypeChanged.connect(this._onMimeTypeChanged, this);
      this._model.value.text = cellModel.value.text.split('\n')[0];
      this._model.mimeType = cellModel.mimeType;

      let model = this._model;
      let editorWidget = new CodeEditorWrapper({ model, factory });
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.editor.setOption('readOnly', true);
      layout.addWidget(prompt);
      layout.addWidget(editorWidget);
    }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / notebook / src / notebooktools.ts View on Github external
let factory = activeCell.contentFactory.editorFactory;

      let cellModel = (this._cellModel = activeCell.model);
      cellModel.value.changed.connect(
        this._onValueChanged,
        this
      );
      cellModel.mimeTypeChanged.connect(
        this._onMimeTypeChanged,
        this
      );
      this._model.value.text = cellModel.value.text.split('\n')[0];
      this._model.mimeType = cellModel.mimeType;

      let model = this._model;
      let editorWidget = new CodeEditorWrapper({ model, factory });
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.addClass('jp-InputArea-editor');
      editorWidget.editor.setOption('readOnly', true);
      layout.addWidget(prompt);
      layout.addWidget(editorWidget);
    }