本文整理汇总了TypeScript中@jupyterlab/notebook.ToolbarItems类的典型用法代码示例。如果您正苦于以下问题:TypeScript ToolbarItems类的具体用法?TypeScript ToolbarItems怎么用?TypeScript ToolbarItems使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToolbarItems类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return the default items of the panel toolbar', () => {
const names = ToolbarItems.getDefaultItems(panel).map(
item => item.name
);
expect(names).to.deep.equal([
'save',
'insert',
'cut',
'copy',
'paste',
'run',
'interrupt',
'restart',
'cellType',
'spacer',
'kernelName',
'kernelStatus'
]);
});
示例2: it
it('should run and advance when clicked', (done) => {
let button = ToolbarItems.createRunButton(panel);
let widget = panel.notebook;
let next = widget.widgets[1] as MarkdownCell;
widget.select(next);
let cell = widget.activeCell as CodeCell;
cell.model.outputs.clear();
next.rendered = false;
Widget.attach(button, document.body);
startSession(panel.context).then(session => {
session.statusChanged.connect((sender, status) => {
if (status === 'idle' && cell.model.outputs.length > 0) {
expect(next.rendered).to.be(true);
button.dispose();
done();
}
});
button.node.click();
});
});
示例3: it
it("should have the `'jp-CutIcon'` class", () => {
let button = ToolbarItems.createCutButton(panel);
expect(button.hasClass('jp-CutIcon')).to.be(true);
});
示例4: it
it("should have the `'jp-AddIcon'` class", async () => {
const button = ToolbarItems.createInsertButton(panel);
Widget.attach(button, document.body);
await framePromise();
expect(button.node.querySelector('.jp-AddIcon')).to.exist;
});