當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript widgets.PanelLayout類代碼示例

本文整理匯總了TypeScript中@phosphor/widgets.PanelLayout的典型用法代碼示例。如果您正苦於以下問題:TypeScript PanelLayout類的具體用法?TypeScript PanelLayout怎麽用?TypeScript PanelLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PanelLayout類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getCurrent

    execute: args => {
      // Clone the OutputArea
      const current = getCurrent({ ...args, activate: false });
      const nb = current.notebook;
      const outputAreaView = (nb.activeCell as CodeCell).cloneOutputArea();
      // Create an empty toolbar
      const toolbar = new Widget();
      toolbar.addClass('jp-Toolbar');
      toolbar.addClass('jp-LinkedOutputView-toolbar');
      // Create a MainAreaWidget
      const layout = new PanelLayout();
      const widget = new MainAreaWidget({ layout });
      widget.id = `LinkedOutputView-${uuid()}`;
      widget.title.label = 'Output View';
      widget.title.icon = NOTEBOOK_ICON_CLASS;
      widget.title.caption = current.title.label ? `For Notebook: ${current.title.label}` : 'For Notebook:';
      widget.addClass('jp-LinkedOutputView');
      layout.addWidget(toolbar);
      layout.addWidget(outputAreaView);
      current.context.addSibling(
        widget, { ref: current.id, mode: 'split-bottom' }
      );

      // Remove the output view if the parent notebook is closed.
      nb.disposed.connect(widget.dispose);
    },
開發者ID:SimonBiggs,項目名稱:jupyterlab,代碼行數:26,代碼來源:index.ts

示例2: constructor

  /**
   * Construct a new `AppWidget`.
   */
  constructor(content: Widget) {
    super();
    this.addClass('jp-FAQ');
    this.title.closable = true;
    this.node.tabIndex = -1;
    this.id = 'faq';
    this.title.label = 'FAQ';

    let toolbar = new Widget();
    toolbar.addClass('jp-FAQ-toolbar');

    let layout = this.layout = new PanelLayout();
    layout.addWidget(toolbar);
    layout.addWidget(content);
  }
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:18,代碼來源:index.ts

示例3: constructor

 /**
  * Construct a new help widget.
  */
 constructor(url: string) {
   super();
   let layout = this.layout = new PanelLayout();
   let iframe = new IFrame();
   this.url = iframe.url = url;
   layout.addWidget(iframe);
 }
開發者ID:7125messi,項目名稱:jupyterlab,代碼行數:10,代碼來源:index.ts

示例4: constructor

  /**
   * Create a dialog panel instance.
   *
   * @param options - The dialog setup options.
   */
  constructor(options: Dialog.IOptions={}) {
    super();
    this.addClass('jp-Dialog');
    options = Private.handleOptions(options);
    let renderer = options.renderer;

    this._host = options.host;
    this._defaultButton = options.defaultButton;
    this._buttons = options.buttons;
    this._buttonNodes = toArray(map(this._buttons, button => {
      return renderer.createButtonNode(button);
    }));
    this._primary = (
      options.primaryElement || this._buttonNodes[this._defaultButton]
    );

    let layout = this.layout = new PanelLayout();
    let content = new Panel();
    content.addClass('jp-Dialog-content');
    layout.addWidget(content);

    let header = renderer.createHeader(options.title);
    let body = renderer.createBody(options.body);
    let footer = renderer.createFooter(this._buttonNodes);
    content.addWidget(header);
    content.addWidget(body);
    content.addWidget(footer);
  }
開發者ID:charnpreetsingh185,項目名稱:jupyterlab,代碼行數:33,代碼來源:dialog.ts

示例5: insertItem

 /**
  * Insert an item into the toolbar at the specified index.
  *
  * @param index - The index at which to insert the item.
  *
  * @param name - The name of the item.
  *
  * @param widget - The widget to add.
  *
  * @returns Whether the item was added to the toolbar. Returns false if
  *   an item of the same name is already in the toolbar.
  *
  * #### Notes
  * The index will be clamped to the bounds of the items.
  */
 insertItem(index: number, name: string, widget: T): boolean {
   let existing = find(this.names(), value => value === name);
   if (existing) {
     return false;
   }
   widget.addClass(TOOLBAR_ITEM_CLASS);
   let layout = this.layout as PanelLayout;
   layout.insertWidget(index, widget);
   Private.nameProperty.set(widget, name);
   return true;
 }
開發者ID:rlugojr,項目名稱:jupyterlab,代碼行數:26,代碼來源:index.ts

示例6: constructor

  constructor(model: RenderableDiffModel<T>, editorClass: string[],
              rendermime: IRenderMimeRegistry, mimetype: string) {
    super();
    this.rendermime = rendermime;
    this.model = model;
    this.mimetype = mimetype;
    let bdata = model.base;
    let rdata = model.remote;
    this.layout = new PanelLayout();

    let ci = 0;
    if (bdata) {
      let widget = this.createSubView(bdata, model.trusted);
      this.layout.addWidget(widget);
      widget.addClass(editorClass[ci++]);
    }
    if (rdata && rdata !== bdata) {
      let widget = this.createSubView(rdata, model.trusted);
      this.layout.addWidget(widget);
      widget.addClass(editorClass[ci++]);
    }
  }
開發者ID:vidartf,項目名稱:nbdime,代碼行數:22,代碼來源:renderable.ts

示例7: constructor

  /**
   * Create a dialog panel instance.
   *
   * @param options - The dialog setup options.
   */
  constructor(options: Partial<Dialog.IOptions<T>>={}) {
    super();
    this.addClass('jp-Dialog');
    let normalized = Private.handleOptions(options);
    let renderer = normalized.renderer;

    this._host = normalized.host;
    this._defaultButton = normalized.defaultButton;
    this._buttons = normalized.buttons;
    this._buttonNodes = toArray(map(this._buttons, button => {
      return renderer.createButtonNode(button);
    }));

    let layout = this.layout = new PanelLayout();
    let content = new Panel();
    content.addClass('jp-Dialog-content');
    layout.addWidget(content);

    this._body = normalized.body;

    let header = renderer.createHeader(normalized.title);
    let body = renderer.createBody(normalized.body);
    let footer = renderer.createFooter(this._buttonNodes);
    content.addWidget(header);
    content.addWidget(body);
    content.addWidget(footer);

    this._primary = this._buttonNodes[this._defaultButton];

    if (options.focusNodeSelector) {
      let el = body.node.querySelector(options.focusNodeSelector);
      if (el) {
        this._primary = el as HTMLElement;
      }
    }
  }
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:41,代碼來源:dialog.ts

示例8: removeItem

 /**
  * Remove an item in the toolbar by value.
  *
  *  @param name - The name of the widget to remove from the toolbar.
  */
 removeItem(widget: T): void {
   let layout = this.layout as PanelLayout;
   layout.removeWidget(widget);
 }
開發者ID:rlugojr,項目名稱:jupyterlab,代碼行數:9,代碼來源:index.ts


注:本文中的@phosphor/widgets.PanelLayout類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。