当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ILabShell.widgets方法代码示例

本文整理汇总了TypeScript中@jupyterlab/application.ILabShell.widgets方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ILabShell.widgets方法的具体用法?TypeScript ILabShell.widgets怎么用?TypeScript ILabShell.widgets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@jupyterlab/application.ILabShell的用法示例。


在下文中一共展示了ILabShell.widgets方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: while

    execute: args => {
      const path = (args.path as string) || '';
      const browserForPath = Private.getBrowserForPath(path, factory);

      // Check for browser not found
      if (!browserForPath) {
        return;
      }
      // Shortcut if we are using the main file browser
      if (browser === browserForPath) {
        labShell.activateById(browser.id);
        return;
      } else {
        const areas: ILabShell.Area[] = ['left', 'right'];
        for (let area of areas) {
          const it = labShell.widgets(area);
          let widget = it.next();
          while (widget) {
            if (widget.contains(browserForPath)) {
              labShell.activateById(widget.id);
              return;
            }
            widget = it.next();
          }
        }
      }
    }
开发者ID:ellisonbg,项目名称:jupyterlab,代码行数:27,代码来源:index.ts

示例2: String

    execute: (args: JSONObject) => {
      const cwd = args['cwd'] ? String(args['cwd']) : '';
      const id = `launcher-${Private.id++}`;
      const callback = (item: Widget) => {
        labShell.add(item, 'main', { ref: id });
      };
      const launcher = new Launcher({ cwd, callback, commands });

      launcher.model = model;
      launcher.title.label = 'Launcher';
      launcher.title.iconClass = 'jp-LauncherIcon';

      let main = new MainAreaWidget({ content: launcher });

      // If there are any other widgets open, remove the launcher close icon.
      main.title.closable = !!toArray(labShell.widgets('main')).length;
      main.id = id;

      labShell.add(main, 'main', { activate: args['activate'] as boolean });

      labShell.layoutModified.connect(() => {
        // If there is only a launcher open, remove the close icon.
        main.title.closable = toArray(labShell.widgets('main')).length > 1;
      }, main);

      return main;
    }
开发者ID:afshin,项目名称:jupyterlab,代码行数:27,代码来源:index.ts

示例3: contextMenuWidget

 execute: () => {
   const widget = contextMenuWidget();
   if (!widget) {
     return;
   }
   const { id } = widget;
   const otherWidgets = toArray(labShell.widgets('main')).filter(
     widget => widget.id !== id
   );
   closeWidgets(otherWidgets);
 }
开发者ID:alexmorley,项目名称:jupyterlab,代码行数:11,代码来源:index.ts

示例4:

 isEnabled: () => {
   // Ensure there are at least two widgets.
   const iterator = labShell.widgets('main');
   return !!iterator.next() && !!iterator.next();
 },
开发者ID:alexmorley,项目名称:jupyterlab,代码行数:5,代码来源:index.ts

示例5: toArray

 labShell.layoutModified.connect(() => {
   // If there is only a launcher open, remove the close icon.
   main.title.closable = toArray(labShell.widgets('main')).length > 1;
 }, main);
开发者ID:afshin,项目名称:jupyterlab,代码行数:4,代码来源:index.ts

示例6: toArray

 () => {
   // If there is only a launcher open, remove the close icon.
   main.title.closable = toArray(labShell.widgets('main')).length > 1;
 },
开发者ID:alexmorley,项目名称:jupyterlab,代码行数:4,代码来源:index.ts


注:本文中的@jupyterlab/application.ILabShell.widgets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。