этот вопрос похож на ElementListSelectionDialog не имеет элементов , но предлагаемое решение не работает.Я следовал руководству по vogella, чтобы создать ElementListSelectionDialog из http://www.vogella.com/tutorials/EclipseDialogs/article.html,, диалоговое окно появляется, но в списке ничего не отображается.мой код
@Execute
public void execute(Shell shell) {
ElementListSelectionDialog elementListSelectionDialog = new ElementListSelectionDialog(shell, new LabelProvider());
elementListSelectionDialog.setMultipleSelection(true);
elementListSelectionDialog.setIgnoreCase(true);
elementListSelectionDialog.setAllowDuplicates(true);
elementListSelectionDialog.setMessage("Select the CUSIP to Fix");
elementListSelectionDialog.setTitle("Incorrect Yield Fixer");
String[] elements = {"Ashish","Tyagi"};
logger.debug("calling setElements {}",Arrays.toString(elements));
elementListSelectionDialog.setElements(elements);
if(elementListSelectionDialog.open() == SWT.OK) {
String[] controlLocation = (String[]) elementListSelectionDialog.getResult();
logger.info("controlLocation is {}",Arrays.toString(controlLocation));
}
}
, если у кого-то есть какие-либо предложения, пожалуйста, дайте мне знать.
вывод:
![enter image description here](https://i.stack.imgur.com/XKMpg.png)