public interface ProgramModel
TreeNode
interface is concerned with the structure of trees whereas
the ProgramNode
interface deals with the concrete content of the nodes of the tree.
public class UpdateProgramExampleContribution implements ProgramNodeContribution { ProgramModel programModel; public UpdateProgramExampleContribution(URCapAPI urCapAPI) { this.programModel = urCapAPI.getProgramModel(); } private void insertIntoProgramTree() { TreeNode treeNode = programModel.createRootTreeNode(this); try { treeNode.addChild(programModel.getProgramNodeFactory().createCommentNode()); } catch (TreeStructureException e) { // Your handler code } } //... //... rest of the implementation and a call to insertIntoProgramTree() //... }
Modifier and Type | Method and Description |
---|---|
ProgramNodeFactory |
getProgramNodeFactory()
This method returns a
ProgramNodeFactory to create program nodes. |
TreeNode |
getRootTreeNode(ProgramNodeContribution root)
Gets the
TreeNode root from ProgramNodeContribution . |
ProgramNodeFactory getProgramNodeFactory()
ProgramNodeFactory
to create program nodes.TreeNode getRootTreeNode(ProgramNodeContribution root)
TreeNode
root from ProgramNodeContribution
. From here, children can be added to form a
sub-tree.root
- The URCap program node where a sub-tree is to be rooted.TreeNode
root.Copyright © 2020. All rights reserved.