[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

Vicente Rico Guillén a écrit :


Well. I'll explain better... and thanks for answer :-D
My app has 3 view modes: 2 tables and 1 gallery.
I have a button that rotates between these 3 views.
When the user push a button, the program rotates between these views, as i said before. The program fill the view perfectly, but when the selected view is populated, i want to show the first elements (if not empty). The order is "selectItem(int itemNumber);"


Then, the code for tables is this:


public void selectItemNumber(int item) { if (GlobalSettings.moviesList.size() > 0) { moviesTable.setFocus(); moviesTable.setSelection(item); moviesTable.notifyListeners(SWT.Selection, new Event()); return; } else { return; } }



This works for the tables, but with the gallery don't.
I've tried the same for gallery but it's impossible.

setSelection( int index) does not exist in the gallery yet, please open a bug if you need it.


But you'll get the same result using :
setSelection( galleryGroup.getItem( index ) )

Keep in mind that Gallery is a Tree and groups are root items. So you need to call getItem() on the parent group of your item.

--
Nicolas