outerGroup.setText(message); // + " - " + possibleItems.size());
outerGroup.setLayout(new GridLayout());
outerGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
final ScrolledComposite scroll = new ScrolledComposite(outerGroup,
SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
scroll.setLayout(new GridLayout());
scroll.setExpandHorizontal(true);
scroll.setExpandVertical(true);
scroll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
final Composite itemsGroup = new Composite(scroll, SWT.NONE);
scroll.setContent(itemsGroup);
grLy = new GridLayout();
grLy.numColumns = 1;
itemsGroup.setLayout(grLy);
itemsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
ButtonAdapter adapter = new ButtonAdapter();
itemButtonArray = new Button[possibleItems.size()];
int i = 0;
for (String text : possibleItems)
{
Button itemBox = new Button(itemsGroup, multipleSelect ? SWT.CHECK : SWT.RADIO);
itemButtonArray[i++] = itemBox;
itemBox.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false));
but2orig.put(itemBox, text);
if (use3dots)
{
String txt = truncate(text, itemBox.getFont(), width - 87);
if (!txt.equals(text))
{
itemBox.setToolTipText(text);
text = txt;
}
}
itemBox.setText(text);
itemBox.addSelectionListener(adapter);
itemBox.setSelection(selectedItems.contains(but2orig.get(itemBox)));
}
itemsGroup.pack();
scroll.setMinSize(itemsGroup.getSize());
Composite leftButtonsGroup = new Composite(shell, SWT.NONE);
leftButtonsGroup.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false));
leftButtonsGroup.setLayout(new RowLayout());