this.selectedPath = getPath( event.getSelectedItem() );
this.categorySelectHandler.selected( selectedPath );
}
public void onOpen(OpenEvent<TreeItem> event) {
TreeItem item = event.getTarget();
if ( hasBeenLoaded( item ) ) {
return;
}
final TreeItem root = item;
//walk back up to build a tree
this.selectedPath = getPath( item );
categoryService.loadChildCategories( selectedPath,
new GenericCallback<String[]>() {
public void onSuccess(String[] list) {
TreeItem child = root.getChild( 0 );
if ( child instanceof PendingItem ) {
// root.removeItem( child );
child.setVisible( false );
}
for ( int i = 0; i < list.length; i++ ) {
TreeItem it = new TreeItem();
it.setHTML( AbstractImagePrototype.create(images.categorySmall()).getHTML() + h( list[i] ) );
it.setUserObject( list[i] );
it.addItem( new PendingItem() );
root.addItem( it );
}
}