Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从eclipse插件动态更新TreeViewer_Java_Eclipse Plugin_Eclipse Rcp_Jface - Fatal编程技术网

Java 从eclipse插件动态更新TreeViewer

Java 从eclipse插件动态更新TreeViewer,java,eclipse-plugin,eclipse-rcp,jface,Java,Eclipse Plugin,Eclipse Rcp,Jface,我正在创建一个eclipse插件,它要求在域对象更改时动态更新TreeViewer 我在eclipse站点上找到了一篇文章 本文在下面提到注册域对象更改的代码 /** Because the domain model does not have a richer * listener model, recursively add this listener * to each child box of the given box. */ protected void addListener

我正在创建一个eclipse插件,它要求在域对象更改时动态更新TreeViewer

我在eclipse站点上找到了一篇文章

本文在下面提到注册域对象更改的代码

/** Because the domain model does not have a richer
 * listener model, recursively add this listener
 * to each child box of the given box. */
protected void addListenerTo(MovingBox box) {
    box.addListener(this);
    for (Iterator iterator = box.getBoxes().iterator(); iterator.hasNext();) {
       MovingBox aBox = (MovingBox) iterator.next();
       addListenerTo(aBox);
    }
}
它提到了
MovingBox
的addListener方法,在本例中,它被认为是域对象。本文没有为
MovingBox
实现提供任何代码示例。我在理解
addListener
方法从何而来方面面临很多困难


我在网上搜索了很多,以找到任何可以在域更改时动态更新的Treeview工作示例。不确定我是否在寻找正确的东西。有人能帮我一下吗?

本文开头“源代码”部分给出的链接中提供了这个TreeViewer示例的所有源代码


链接是

本例的所有源代码都包含在文章开头的“源代码”部分中。哦,我没有注意到有点匆忙,请将其作为答案发布。谢谢你的帮助。