[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.nebula] Re: select item in the gallery widget

Nicolas Richeton escribiÃ:


You uses moviesGallery.setItemCount(1); This creates one group (group are root level items, you'll see the group with the default group renderer).
- Please test your code with both the latest stable release and the latest nightly build. (http://www.eclipse.org/nebula/downloads.php)


- Try to remove moviesGallery.setVirtualGroups(true); . This method improves init time when a lot of groups are used ( 50+). It is totally useless in your case and since this is a quite new feature, it may be the issue.

- Your setData handler should test if the item is a group or an item. (getParentItem() == null for groups). You are setting item count > 0 for every item. This currenlty works because renderers only paint 2 levels of items, but will create an infinite loop in the future.

- If this does not solve your problem, open a bug and attach a Junit test case or a snippet showing the bug (see http://www.eclipse.org/swt/snippets/ for sample snippets).



Thanks!!!. When i removed "moviesGallery.setVirtualGroups(true), i've executed the app, and it works!!! Now selects fine the first element.
The apps works with: moviesGallery.setSelection( new GalleryItem[]{ moviesGallery.getItem(0).getItem(number) } );


and now, i'm able to select programmatically every number i want. I suppose the order is: moviesgallery.getItem(group).getItem(number of a item in this group). Is this right?