本文整理汇总了TypeScript中@jupyterlab/filebrowser.FileBrowser类的典型用法代码示例。如果您正苦于以下问题:TypeScript FileBrowser类的具体用法?TypeScript FileBrowser怎么用?TypeScript FileBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileBrowser类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: FileBrowserModel
const createFileBrowser = (
id: string,
options: IFileBrowserFactory.IOptions = {}
) => {
const model = new FileBrowserModel({
manager: docManager,
driveName: options.driveName || '',
state: options.state === null ? null : options.state || state
});
const widget = new FileBrowser({
id,
model,
commands: options.commands || commands
});
const { registry } = docManager;
// Add a launcher toolbar item.
let launcher = new ToolbarButton({
className: 'jp-AddIcon',
onClick: () => {
return createLauncher(commands, widget);
},
tooltip: 'New Launcher'
});
launcher.addClass('jp-MaterialIcon');
widget.toolbar.insertItem(0, 'launch', launcher);
// Add a context menu handler to the file browser's directory listing.
let node = widget.node.getElementsByClassName('jp-DirListing-content')[0];
node.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
const model = widget.modelForClick(event);
const menu = createContextMenu(model, commands, registry);
menu.open(event.clientX, event.clientY);
});
// Track the newly created file browser.
tracker.add(widget);
return widget;
};
开发者ID:dalejung,项目名称:jupyterlab,代码行数:41,代码来源:index.ts
示例2: createContextMenu
node.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
const model = widget.modelForClick(event);
if (model) {
const menu = createContextMenu(model, commands, registry);
menu.open(event.clientX, event.clientY);
}
});
开发者ID:7125messi,项目名称:jupyterlab,代码行数:8,代码来源:index.ts
示例3:
execute: () => {
const item = browser.selectedItems().next();
if (!item) {
return;
}
Clipboard.copyToSystem(item.path);
},
开发者ID:dalejung,项目名称:jupyterlab,代码行数:8,代码来源:index.ts
示例4:
execute: () => {
const widget = tracker.currentWidget;
if (!widget) {
return;
}
return browser.model.manager.services.contents
.getDownloadUrl(browser.selectedItems().next().path)
.then(url => {
Clipboard.copyToSystem(url);
});
},
开发者ID:willingc,项目名称:jupyterlab,代码行数:12,代码来源:index.ts
示例5: createContextMenu
node.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
const path = widget.pathForClick(event) || '';
const menu = createContextMenu(path, commands, registry);
menu.open(event.clientX, event.clientY);
});
开发者ID:sccolbert,项目名称:jupyterlab,代码行数:6,代码来源:index.ts
示例6:
execute: () => { fbWidget.download(); },
开发者ID:samvasko,项目名称:jupyterlab,代码行数:1,代码来源:index.ts
注:本文中的@jupyterlab/filebrowser.FileBrowser类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论