Friday, July 6, 2012

Google Web Toolkit : Tree.addTreeListener is deprecated what should I use instead.

Hello, 

I'm learning about the Google web toolkit from the book "Beginning Google Web Toolkit" 
I have got to the part where it starts using a Tree widget. 
It uses Tree.addTreeListener() which apparently is now deprecated. 
I can't work out what to use instead. 

There is a class called Category and I'm creating a tree of Category. 

The method below is where the problem is: 

  1.  protected Widget createCategoriesWidget() {  
  2.     Tree categoryTree = new Tree();  
  3.     categoryTree.setWidth("100%");  
  4.     categoryTree.addTreeListener(new TreeListener() {  
  5.       public void onTreeItemSelected(TreeItem item) {  
  6.         selectedCategory = ((CategoryTreeItem)item).getCategory();  
  7.         updateTasksList();  
  8.       }  
  9.     });  
  10.       
  11.     List<Category> categories = getAllCategories();  
  12.     for (final Category category : categories) {  
  13.       CategoryTreeItem item = createTreeItem(category);  
  14.       categoryTree.addItem(item);  
  15.     }  
  16.     return categoryTree;  
  17.   }  
Does anyone know how to rewrite this method so it isn't deprecated?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/7bsPH0QxLw8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment