All files / views/trees/definition-tree/nodes concept-scheme-node.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 3/3
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                      1x       2x                   38x          
import * as vscode from "vscode";
import { DefinitionTreeNode } from "../definition-tree-node";
import { GroupContainerNode } from "./group-container-node";
import { ConceptsNode } from "./concepts/concepts-node";
import { CollectionsNode } from "./collections/collections-node";
 
/**
 * Node of a SKOS concept scheme in the definition tree.
 */
export class ConceptSchemeNode extends GroupContainerNode {
	override getIcon() {
		return new vscode.ThemeIcon('rdf-concept-scheme', this.getIconColor());
	}
 
	override getIconColor() {
		return new vscode.ThemeColor("mentor.color.class");
	}
 
	/**
	 * Create the group nodes that may be listed below this node, whether they have children or not.
	 * @returns The group nodes in the order they are displayed.
	 */
	protected override createGroupNodes(): DefinitionTreeNode[] {
		// Note: Concepts and collections are associated with a concept scheme via skos:inScheme, so the
		// definedBy option that is inherited from this node must not be applied to them.
		return [
			this.createChildNode(ConceptsNode, 'mentor:concepts', { definedBy: undefined, inScheme: this.uri }),
			this.createChildNode(CollectionsNode, 'mentor:collections', { definedBy: undefined, inScheme: this.uri })
		];
	}
}