本文整理匯總了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);
}