如何填充 CheckedTreeSelectionDialog
我正在编写一个测试来学习如何使用 CheckedTreeSelectionDialog
。这是代码。
CheckedTreeSelectionDialog dialog =
new CheckedTreeSelectionDialog(shell, new LabelProvider(), new TreeContentProvider() );
dialog.setTitle("Tree Selection");
dialog.setMessage("Select the elements from the tree:");
ElementTree et = new ElementTree();
et.createElement(new Path("element_1"), "element_1");
dialog.setInput(dt);
dialog.open();
但我得到了异常:
org.eclipse.swt.SWTException: 无法执行可运行 (java.lang.NoClassDefFoundError: org/eclipse/pde/internal/ui/elements/TreeContentProvider)
我真的很感谢任何提示!
谢谢!
I'm writing a test to learn how to use CheckedTreeSelectionDialog
. This is the code.
CheckedTreeSelectionDialog dialog =
new CheckedTreeSelectionDialog(shell, new LabelProvider(), new TreeContentProvider() );
dialog.setTitle("Tree Selection");
dialog.setMessage("Select the elements from the tree:");
ElementTree et = new ElementTree();
et.createElement(new Path("element_1"), "element_1");
dialog.setInput(dt);
dialog.open();
But I get the exception:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoClassDefFoundError: org/eclipse/pde/internal/ui/elements/TreeContentProvider)
I really appreciate any hint!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能使用 org.eclipse.pde.internal.ui.elements.TreeContentProvider 类,因为它仅适用于 Eclipse PDE(包“internal”中的类不适合由客户使用)。
相反,您应该创建自己的 TreeContentProvider,实现接口 org.eclipse.jface.viewers.ITreeContentProvider,就像您对 TreeViewer 所做的那样。教程位于此处。
You can't use the class
org.eclipse.pde.internal.ui.elements.TreeContentProvider
because it's only available for Eclipse PDE (the classes that are in a package 'internal' are not intended to be used by client).Instead you should create your own TreeContentProvider, implementing the interface
org.eclipse.jface.viewers.ITreeContentProvider
, as you would do for aTreeViewer
. A tutorial is here.