Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » TreeViewer Performance
TreeViewer Performance [message #327628] Sat, 26 April 2008 20:37
Eclipse UserFriend
Originally posted by: micha.bgl.gmx.de

Hi there,

relating to this topic I found already a few threads in the internet. I have
in one view a treeviewer with some tabs which is updated by several actions
in another view. Cause I don't want to reload the view with the tree viewer
(it's the center view of my plug-in) , I would like to use this TreeViewer
even to present some tables. This is also no problem. But the amount of data
(10000 elements). In fact if I use the TreeViewer as "TableViewer" (all
elements of the input list are parents without any children) the performance
is really bad. I've already read that it is possible to use SWT.VIRTUAL and
ILazyTreeContentProvider to solve the performance problem for TreeViewer
with a lot of parents and children. So I adpated the snippet047, but it
didn't work.

here is my code:

public LazyRawContentProvider(){
model = Calculation.getInstance(); // model for getting my data
}

@Override
public Object getParent(Object element) {
return model.getDatalines().toArray();
}

@Override
public void updateChildCount(Object element, int currentChildCount) {
int length = 0;
if(element == elements)
length = elements.length;
tviewer.setChildCount(element, length);
}

@Override
public void updateElement(Object parent, int index) {
Object element;
element = elements[index];
tviewer.replace(parent, index, element);
updateChildCount(element, -1);
}

@Override
public void dispose() {
// TODO Auto-generated method stub

}

@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
this.tviewer = (TreeViewer) viewer;
this.elements = (Object[])newInput;
}

I hope you can help me. Thanks.

ciao,
micha
Previous Topic:Eclipse help plugin - F1 search
Next Topic:Do something after the view was opened.
Goto Forum:
  


Current Time: Wed Jun 26 19:35:37 GMT 2024

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

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

Back to the top