如何将 Eclipse RCP Table View 绑定到其他线程数据
我刚刚开始使用 Eclipse RCP。 我使用 TableViewer 和 WritableList 创建了 Eclipse RCP View 以从其他线程获取数据。 但我看不到任何变化。我只需要显示其他线程正在管理的列表的内容。
public class View extends ViewPart {
private TableViewer viewer;
private WritableList input;
我也可以得到错误,
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Getter called outside realm of observable org.eclipse.core.databinding.observable.list.WritableList
我知道什么是 UI 线程。我只是不知道怎么写。请帮忙举个例子。
更新。没有解决,因为缺乏时间,并且缺少好的和有针对性的教程。
I have just started with Eclipse RCP.
I created Eclipse RCP View with TableViewer and WritableList to get data from other thread.
But I cannot see any changes. I need only to show content of List that other thread is managing.
public class View extends ViewPart {
private TableViewer viewer;
private WritableList input;
I also can get error,
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Getter called outside realm of observable org.eclipse.core.databinding.observable.list.WritableList
I know what is UI Thread. I just don't know how to write. Please help with example.
UPDATE. Was not solved, because of lack of time, and missing good and focused tutorial.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的代码也收到了此错误消息。
数据绑定可观察对象(WritableList、WritableValue...)继承自
ChangeManager
,它提供ChangeManager#getRealm
并且领域具有Realm#exec
。在提供给 exec 的可运行对象中,操作在正确的线程中运行。这一行导致了错误(Getter 在可观察范围之外调用了):
这防止了异常:
同样适用于
WritableList
,因为它也继承自ChangeManager< /代码>。
I received this error message also with my code.
Databinding observables (WritableList, WritableValue...) inherit from
ChangeManager
, which providesChangeManager#getRealm
and the realm hasRealm#exec
. Within the runnable provided toexec
, the operation runs in the correct thread.This line caused the error (Getter called outside realm of observable):
And this prevented the exception:
The same will work with
WritableList
since it also inherits fromChangeManager
.