[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: question re. TableTree-viewer's refresh behavior


"Tom Schindl" <tom.schindl@xxxxxxxxxxxxxxx> wrote in message news:ejhl8l$rgo$1@xxxxxxxxxxxxxxxxxxxx
Hi,

first of all TableTreeViewer should have been deprecated in 3.2 and you should better use a TreeViewer instead.

Yes, that's what I am using. I grew acustomed to the old name (when I use it in that "tabletree-mode"), but actually I am using the new TreeViewer.


If you only want to refresh a specific part of your tree then you could use refresh(Object,boolean) and not the whole tree gets refershed on the other hand TreeViewer tries to preserve the selection which doesn't work for you it seems.

I guess you are recreating *all* model elements from scratch everytime your content-providers getElements-method is called. If that's the case TreeViewer/TableTreeViewer is not able to preservet the selection and you need this your own.

You are right. I hadn't been aware that I was actually recreating the elements, but since the model only provides the children as collection while the ITreeContentProvider
has to return them as array, in getChildren() I am actually creating a new array containing the children each time.


Hm, but wait a minute: the *content* of those arrays are always the very same objects each time. Or is the model only passing out copies, only?
<5 minutes later:>
Grrr - Indeed! The model passes out copies only! %$#&@!!! I need to have a chat with some (too) security/stability minded folks... :-(


Michael