Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如标题已经说过的那样......我想打开一个 ElementTreeSelectionDialog ,其中的树已经展开。有什么办法吗?
问候,迈克尔
ElementTreeSelectionDialog 没有开箱即用的此功能,但您可以轻松扩展它以添加此行为。只需将其子类化并覆盖 createTreeViewer 方法。调用此方法的超级版本后,您将获得对话框的初始化 TreeViewer 的句柄。那时,只需使用 TreeViewer.setExpanded() 或 TreeItem.setExpanded() API 就可以根据需要进行扩展。