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.
我尝试显示一个对话框以选择源的字段。我喜欢使用 ListSelectionDialog,但我不确定输入参数使用什么。网络中的所有示例都使用 ResourcesPlugin.getWorkspace().getRoot() 作为输入,是的,所有项目都显示出来了。但我有一个要显示以供选择的字段列表(IField [])。ListSelectionDialog 的构造函数接受参数,但对话框什么也没显示... :( 有人知道吗?非常感谢!Sven
我不认为使用BaseWorkbenchContentProvider是正确的。试试ArrayContentProvider。
BaseWorkbenchContentProvider
ArrayContentProvider
所以像:
new ListSelectionDialog(shell, fields, new ArrayContentProvider(), labelProvider, msg);