【问题标题】:How to populate CheckedTreeSelectionDialog如何填充 CheckedTreeSelectionDialog
【发布时间】:2012-01-12 16:13:15
【问题描述】:

我正在编写一个测试来学习如何使用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: 无法执行 runnable (java.lang.NoClassDefFoundError: org/eclipse/pde/internal/ui/elements/TreeContentProvider)

我真的很感激任何提示!

谢谢!

【问题讨论】:

    标签: eclipse eclipse-plugin eclipse-pde


    【解决方案1】:

    您不能使用 org.eclipse.pde.internal.ui.elements.TreeContentProvider 类,因为它仅适用于 Eclipse PDE(包“内部”中的类不打算供客户端使用)。

    相反,您应该创建自己的 TreeContentProvider,实现接口 org.eclipse.jface.viewers.ITreeContentProvider,就像您为 TreeViewer 所做的那样。教程是here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-30
      • 2012-02-15
      • 2013-04-16
      • 1970-01-01
      • 2012-06-26
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多