Getting all visible Elements in a Tree [message #462361] |
Sat, 27 January 2007 17:37 |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Hello,
I have a tree inside a view. I have defined some FontFieldEditors within
my preference pages, where i can customize the font of the tree
elements. Therefore, I use the Interface ITableFontProvider.
This works perfect, when I call viewer.refresh() within the
propertyChange-Method.
if(event.getProperty().equals("edt_usr_host_font")){
viewer.refresh(true);
}
But, refresh forces the tree to be restructured againg. IMHO, this is
not necessary. I think, the update(Elements[])-Method will do the same
work. But how can i get all the visible Elements in the tree, which are
possibly forced to be redrawn? I tried with getExpandedElements(), but
this does not work.
I want to do this:
if(event.getProperty().equals("edt_usr_host_font")){
viewer.update(#viewer.getAllVisibleElements());
}
Hope, some one can help me.
Thx
Florian
|
|
|
Re: Getting all visible Elements in a Tree [message #462369 is a reply to message #462361] |
Sat, 27 January 2007 18:07 |
Ilya Shinkarenko Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi Florian,
try to ask in SWT newsgroup.
My opinion on that: I am not sure whether it's a good idea to update
your components based on their current visibility in a table. If user
would scroll, you would have to react upon that and accordingly update
newly revealed elements, since you have no guarantee that those elements
are not stale.
Try to look at KTable, I am not sure but maybe KTable has some support
for that.
Greetz
Ilya
Florian Wendland wrote:
> Hello,
> I have a tree inside a view. I have defined some FontFieldEditors within
> my preference pages, where i can customize the font of the tree
> elements. Therefore, I use the Interface ITableFontProvider.
>
> This works perfect, when I call viewer.refresh() within the
> propertyChange-Method.
>
> if(event.getProperty().equals("edt_usr_host_font")){
> viewer.refresh(true);
> }
>
> But, refresh forces the tree to be restructured againg. IMHO, this is
> not necessary. I think, the update(Elements[])-Method will do the same
> work. But how can i get all the visible Elements in the tree, which are
> possibly forced to be redrawn? I tried with getExpandedElements(), but
> this does not work.
>
> I want to do this:
>
> if(event.getProperty().equals("edt_usr_host_font")){
> viewer.update(#viewer.getAllVisibleElements());
> }
>
> Hope, some one can help me.
>
> Thx
>
> Florian
|
|
|
Powered by
FUDForum. Page generated in 0.03567 seconds