Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TableTreeViewer and its Model
TableTreeViewer and its Model [message #447719] Thu, 16 December 2004 11:35 Go to next message
Eclipse UserFriend
Originally posted by: alejandro.vera.gmail.com

Hello everyone...

first, excuse my english... it's not my mother languaje

My problem is this. I have a TableTreeViewer with its own LabelProvider and ContentProvider. The refresh()
and refresh(boolean) method of the viewer is overraided. The viewer has Filters and sorters.
I am trying to changue the apparence of the rows based in the content of the model.

My question is, how to get the item associated to a specific row in a filtered and sorted table???

I've tryed this

Table table = getTableTree().getTable();
for(int i = 0; table.getItemCount(); i++){
TableItem item = getItem(i);
MyObject element = (MyObject)getElementAt(table.indexOf(item));
if(element.mustBeBold)
item.setFont(boldFont);
else
item.setFont(normalFont);
}

It works, but when i click in the column header to use another sorter, then the viewer is sorted, but the elementes of
table.getItem not...

Can anyone help me? please?

thank you
Re: TableTreeViewer and its Model [message #447921 is a reply to message #447719] Tue, 21 December 2004 18:16 Go to previous message
Eclipse UserFriend
Alejandro,

I do not think that there is an easy way to do this. However, you should
ask this on the eclipse.platform newsgroup, since that is where the jface
developers hang out.

Grant

"Alejandro Vera" <alejandro.vera@gmail.com> wrote in message
news:cpsdg8$b2i$1@www.eclipse.org...
> Hello everyone...
>
> first, excuse my english... it's not my mother languaje
>
> My problem is this. I have a TableTreeViewer with its own LabelProvider
and ContentProvider. The refresh()
> and refresh(boolean) method of the viewer is overraided. The viewer has
Filters and sorters.
> I am trying to changue the apparence of the rows based in the content of
the model.
>
> My question is, how to get the item associated to a specific row in a
filtered and sorted table???
>
> I've tryed this
>
> Table table = getTableTree().getTable();
> for(int i = 0; table.getItemCount(); i++){
> TableItem item = getItem(i);
> MyObject element = (MyObject)getElementAt(table.indexOf(item));
> if(element.mustBeBold)
> item.setFont(boldFont);
> else
> item.setFont(normalFont);
> }
>
> It works, but when i click in the column header to use another sorter,
then the viewer is sorted, but the elementes of
> table.getItem not...
>
> Can anyone help me? please?
>
> thank you
Previous Topic:CellEditorValidator's returned error message
Next Topic:scroll draw2d on a swt canvas
Goto Forum:
  


Current Time: Wed Jul 16 04:36:43 EDT 2025

Powered by FUDForum. Page generated in 0.08312 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top