I think the answer here lies in the way that you've attempted to print the information. System.out.println("Outside loop: " + classesList)
will implicitly call classesList.toString()
. SWT widgets' toString() methods (unless otherwise overridden) form the general pattern:
ClassName {otherInformation}
However, it is up to subclasses to fill otherInformation
with useful data by overriding org.eclipse.swt.widgets.Widget.getNameText()
. List
doesn't do this, so otherInformation
is simply the empty string, and toString() will always[1] return List {}
.
To get the information from that List
that you require, call getItems()
.
[1] unless it is disposed or is called on the wrong thread.