TableTreeViewer and its Model [message #447719] |
Thu, 16 December 2004 11:35  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.08312 seconds