• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript widgets.PanelLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript widgets.SplitPanel类代码示例发布时间:2022-05-28
下一篇:
TypeScript widgets.Panel类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap