I am trying to use ElementListSelectionDialog . I followed the code example, but for some reason the dialog is shown, but without parameters
My code is:
ElementListSelectionDialog dialog = new ElementListSelectionDialog(shlSpriteCreator, new LabelProvider()); dialog.setMultipleSelection(false); dialog.setIgnoreCase(true); dialog.setAllowDuplicates(true); dialog.setMessage("Select an AI"); dialog.setTitle("What AI to use?"); dialog.setElements(new String[]{"HELLO","GOODBYE"}); if (dialog.open() == Window.OK) { aiControllerLocation = (String) dialog.getFirstResult(); }
As a result of the dialogue:

I originally used an array of classes, but since it did not work, I replaced the list of trivial strings, although, as far as I understand, using a LabelProvider class should be able to use any object, and it will be displayed by it in the toString () view.
source share