當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript tree.Tree類代碼示例

本文整理匯總了TypeScript中@eg/share/tree/tree.Tree的典型用法代碼示例。如果您正苦於以下問題:TypeScript Tree類的具體用法?TypeScript Tree怎麽用?TypeScript Tree使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Tree類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: addChildNode

    addChildNode() {
        this.changesMade = true;

        const pnode = this.tree.selectedNode();
        const point = this.idl.create('vmsp');
        point.id(this.newId--);
        point.isnew(true);
        point.parent(pnode.id);
        point.match_set(this.matchSet_.id());
        point.children([]);

        const ptype = this.newPoint.values.pointType;

        if (ptype === 'bool') {
            point.bool_op(this.newPoint.values.boolOp);

        } else {

            if (ptype === 'attr') {
                point.svf(this.newPoint.values.recordAttr);

            } else if (ptype === 'marc') {
                point.tag(this.newPoint.values.marcTag);
                point.subfield(this.newPoint.values.marcSf);
            } else if (ptype === 'heading') {
                point.heading(true);
            }

            point.negate(this.newPoint.values.negate);
            point.quality(this.newPoint.values.matchScore);
        }

        const node: TreeNode = new TreeNode({
            id: point.id(),
            callerData: {point: point}
        });

        // Match points are added to the DB only when the tree is saved.
        this.setNodeLabel(node, point).then(() => pnode.children.push(node));
    }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:40,代碼來源:match-set-expression.component.ts

示例2: isRootNode

 isRootNode(): boolean {
     const node = this.tree.selectedNode();
     if (node && this.tree.findParentNode(node) === null) {
         return true;
     }
     return false;
 }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:7,代碼來源:match-set-expression.component.ts

示例3: selectedIsBool

 selectedIsBool(): boolean {
     if (this.tree) {
         const node = this.tree.selectedNode();
         return node && node.callerData.point.bool_op();
     }
     return false;
 }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:7,代碼來源:match-set-expression.component.ts

示例4: Boolean

 hasSelectedNode(): boolean {
     return Boolean(this.tree.selectedNode());
 }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:3,代碼來源:match-set-expression.component.ts

示例5: deleteNode

 deleteNode() {
     this.changesMade = true;
     const node = this.tree.selectedNode();
     this.tree.removeNode(node);
 }
開發者ID:evergreen-library-system,項目名稱:Evergreen,代碼行數:5,代碼來源:match-set-expression.component.ts


注:本文中的@eg/share/tree/tree.Tree類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。