我正在开发一个 XTEXT 2.0 插件。我想在“虚拟”节点中将大纲内的一些节点分组。哪种方法是实现此结果的正确方法?
目前,如果我想对“A”类型的节点进行分组,在我的 OutlineTreeProvider 中我定义了以下方法
protected void _createNode(IOutlineNode parentNode, A node) {
if(this.myContainerNode == null){
A container = S3DFactoryImpl.eINSTANCE.createA();
super._createNode(parentNode, container);
List<IOutlineNode> children = parentNode.getChildren();
this.myContainerNode = children.get(children.size()-1);
}
super._createNode(this.myContainerNode, node);
}
阅读 Xtext 2.0 文档我还看到有一个 EStructuralFeatureNode。我不完全了解这种类型的节点是什么以及如何使用它。你能解释一下 EStructuralFeatureNode 的用途吗?
非常感谢