当用户在我的 TreeViewer 中展开特定节点时,它应该展开两层而不是一层。所以我添加了以下代码:
viewer.addTreeListener(new ITreeViewerListener() {
public void treeCollapsed(TreeExpansionEvent event) {
}
public void treeExpanded(TreeExpansionEvent event) {
if (event.getElement() instanceof Feature) {
Feature feature = (Feature) event.getElement();
viewer.expandToLevel(feature, 2);
}
}
});
但我只在扩展功能节点时收到此错误消息:
!MESSAGE Ignored reentrant call while viewer is busy. This is only logged once per viewer instance, but similar calls will still be ignored.
!STACK 0
java.lang.RuntimeException
at org.eclipse.jface.viewers.ColumnViewer.checkBusy(ColumnViewer.java:781)
at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1071)
...
任何想法我做错了什么或如何以另一种方式解决它?
干杯,菲尔