[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [platform-swt-dev] Problems with TableViewer VIRTUAL on MAC
- From: "Andrey Tarantsov" <andreyvit@xxxxxxxxx>
- Date: Tue, 29 Jul 2008 23:48:45 +0700
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=s/2iiT1vCMK6xhVyl4OXp+H+aAZcBMKMnaI9e/mi8aU=; b=EGYomhm+VLC93TEbhgzho6uK8bKR57ciza46ly/Lgr3IuS4aJdsmKnNpkx8HbWartP EE4C44iZnx63+ty+FBGXZN256yrmTBt1VTU/7qLGEirZK6gWisHDGVzmcfccyXSHoeD3 Z6gW0Li67i2cn2k8hQuy/GoTVxZseZ9vCvl2U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=Pzz/QWd92C4hhObujHzQ+Z5kIFUD9yKqTVZh40wXGj0TxCb/tSeAJvBEUHXSDlLOwY K+4CHw7JuNVOKmPR7aF1q58sqoK/uy/783zqFuz8+t0PghMhHVaITcZuGTqUntaw1o/t C4Lv2WA2P+gsuMHX2ePxhrddK4XeKBFuHhv1w=
According to the Javadoc of setSelection:
void org.eclipse.jface.viewers.Viewer.setSelection(ISelection selection)
The viewer implementation of this
ISelectionProvider method make the new selection for this viewer without making it visible.
This method is equivalent to
Note that some implementations may not be able to set the selection without also revealing it, for example (as of 3.3) TreeViewer.
I.e. the method does not have to reveal the selection, even though on some platforms it does. What you want is to change your call to:
tableViewer.setSelection(new StructuredSelection(input[input.length-1]), true);
â add ", true" as the last argument:
void org.eclipse.jface.viewers.TableViewer.setSelection(ISelection selection, boolean reveal)
Sets a new selection for this viewer and optionally makes it visible. The TableViewer implementation of this method is inefficient for the ILazyContentProvider as lookup is done by indices rather than elements and may require population of the entire table in worse case.
Use Table#setSelection(int indices) and Table#showSelection() if you wish to set selection more efficiently when using a ILazyContentProvider.