I’m writing a little tail application using Eclipse RCP (4). In my main window I wish to display the contents of a file. My first idea was to use an SWT List component but my problem is when I open a really big file (more than 100000 lines) the List cannot cope with it. Do you have any idea which component should I use for this?
I want to filter and/or highlight the records depending on some criteria but I don’t want to modify so it is read only.
One more thing: since I cannot load an arbitrarily large (say 10 GB) file into memory I just read the position of new line characters into a List and I load the concrete lines into a String only when they are going to be displayed. So I need some component which renders the lines only when they become visible.
You can use
SWT.VIRTUAL, so that you can achieve lazy loading of the data.Here is an example with Table and SWT.VIRTUAL.
However 10GB is alot of information. I would somehow split the file into many chunks and load specific parts of it.
[EDIT]:
Something that you should know:
I’ve tried to implement TreeViewer with about 700k items. The filter/search function was very slow (I’ve used FilteredTree).