TableViwer Alternating rows Colors [message #1065514] |
Wed, 26 June 2013 05:14  |
Eclipse User |
|
|
|
Hello
i have implemented alternating rows color on my TableViewer, i have made some test with 30 000 rows :
without Color alternating i take 20 sec to load the table and 1 m 40 sec with colors alternating.
so my algorithm is not optimized for a table of this size,i would like to implement a méthode demonstrated in this snippet
but it's not the same case, me i have extented ObservableMapLabelProvider (i have used a DataBinding,
public class CompteEntrysLabelProvider extends ObservableMapLabelProvider
implements IColorProvider {
@Override
public Color getBackground(Object element) {
WritableList list = new WritableList() ;
list= (WritableList) this.tableViewer.getInput();
int index = list.indexOf(element);
if ((index % 2) == 0) {
return gray; // color
} else {
return null;
}
}
}
where can i initialize the even variable in my case, or there is an other way to implement a more efficient algorithm.
with my thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.03379 seconds