本文整理汇总了TypeScript中vs/base/parts/quickopen/browser/quickOpenModel.QuickOpenEntryGroup类的典型用法代码示例。如果您正苦于以下问题:TypeScript QuickOpenEntryGroup类的具体用法?TypeScript QuickOpenEntryGroup怎么用?TypeScript QuickOpenEntryGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QuickOpenEntryGroup类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('QuickOpenModel', () => {
const model = new QuickOpenModel();
const entry1 = new QuickOpenEntry();
const entry2 = new QuickOpenEntry();
const entry3 = new QuickOpenEntryGroup();
assert.notEqual(entry1.getId(), entry2.getId());
assert.notEqual(entry2.getId(), entry3.getId());
model.addEntries([entry1, entry2, entry3]);
assert.equal(3, model.getEntries().length);
model.setEntries([entry1, entry2]);
assert.equal(2, model.getEntries().length);
entry1.setHidden(true);
assert.equal(1, model.getEntries(true).length);
assert.equal(entry2, model.getEntries(true)[0]);
});
示例2: _sort
private _sort(elementA: QuickOpenEntryGroup, elementB: QuickOpenEntryGroup): number {
let elementAName = elementA.getLabel().toLowerCase();
let elementBName = elementB.getLabel().toLowerCase();
return elementAName.localeCompare(elementBName);
}