How to use the @lumino/widgets.StackedLayout function in @lumino/widgets

To help you get started, we’ve selected a few @lumino/widgets 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 / packages / settingeditor / src / plugineditor.ts View on Github external
constructor(options: PluginEditor.IOptions) {
    super();
    this.addClass(PLUGIN_EDITOR_CLASS);

    const { commands, editorFactory, registry, rendermime } = options;

    // TODO: Remove this layout. We were using this before when we
    // when we had a way to switch between the raw and table editor
    // Now, the raw editor is the only child and probably could merged into
    // this class directly in the future.
    const layout = (this.layout = new StackedLayout());
    const { onSaveError } = Private;

    this.raw = this._rawEditor = new RawEditor({
      commands,
      editorFactory,
      onSaveError,
      registry,
      rendermime
    });
    this._rawEditor.handleMoved.connect(this._onStateChanged, this);

    layout.addWidget(this._rawEditor);
  }
github jupyterlab / jupyterlab / packages / markdownviewer / src / widget.ts View on Github external
constructor(options: MarkdownViewer.IOptions) {
    super();
    this.context = options.context;
    this.renderer = options.renderer;
    this.node.tabIndex = -1;
    this.addClass(MARKDOWNVIEWER_CLASS);

    const layout = (this.layout = new StackedLayout());
    layout.addWidget(this.renderer);

    void this.context.ready.then(async () => {
      await this._render();

      // Throttle the rendering rate of the widget.
      this._monitor = new ActivityMonitor({
        signal: this.context.model.contentChanged,
        timeout: this._config.renderTimeout
      });
      this._monitor.activityStopped.connect(this.update, this);

      this._ready.resolve(undefined);
    });
  }
github jupyterlab / jupyterlab / packages / fileeditor / src / widget.ts View on Github external
constructor(options: FileEditor.IOptions) {
    super();
    this.addClass('jp-FileEditor');

    const context = (this._context = options.context);
    this._mimeTypeService = options.mimeTypeService;

    let editorWidget = (this.editorWidget = new FileEditorCodeWrapper(options));
    this.editor = editorWidget.editor;
    this.model = editorWidget.model;

    // Listen for changes to the path.
    context.pathChanged.connect(this._onPathChanged, this);
    this._onPathChanged();

    let layout = (this.layout = new StackedLayout());
    layout.addWidget(editorWidget);
  }