} );
tree.addOpenHandler( new OpenHandler<TreeItem>() {
@Override
public void onOpen( final OpenEvent<TreeItem> event ) {
final TreeItem item = event.getTarget();
if ( needsLoading( item ) ) {
final Object userObject = event.getTarget().getUserObject();
presenter.loadClassFields( ( (ClassUserObject) userObject ).fullyQualifiedClassName,
new Callback<List<String>>() {
@Override
public void callback( final List<String> fields ) {
item.getChild( 0 ).remove();
if ( fields != null ) {
for ( String field : fields ) {
final TreeItem fi = new TreeItem();
fi.setHTML( AbstractImagePrototype.create( DRLTextEditorResources.INSTANCE.images().fieldImage() ).getHTML()
+ "<small>"
+ field + "</small>" );
fi.setUserObject( field );
item.addItem( fi );
}
}
}
} );