Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » TreeView contents mysteriously vanish
TreeView contents mysteriously vanish [message #187082] Fri, 30 January 2004 04:55 Go to next message
Eclipse UserFriend
Originally posted by: roger.senanque.co.nz

I have a TextEditor and a TreeView (similar to the Java code and method
tree).
It generally works. When I update the text the tree updates, driven by
IDocumentListener.documentChanged method, and refreshes the tree.

The trouble is that refreshing the tree is a big operation and I don't
need to do it on every keystroke. It makes the tree flicker unnecessarily.
So I put in a counter so that I only do it every three keystokes. This is
all inside the documentChanged method. When I hit the third keystroke the
tree vanishes. I also put in code to detect if the number of lines changes
and I always refresh the tree in that case. If I hit Enter, creating a new
line, the tree refreshes. But if I hit three keys (eg abc) the tree
vanishes. I doesn't come back when I hit Enter.

I have tried using: MyPlugin.getWorkspace().run(new
IWorkspaceRunnable()... and putting the code in the run method, but it
makes no difference. I also experimented with ModalContext.run, telling it
to fork, but I got an assertion failed. I also tried:
Display.getDefault().asyncExec(new Runnable()... and running the update in
a synchronized method in the Runnable class. That didn't help either. I
was hoping it was getting too many updates at a time and some thread
somewhere was getting confused.

Does anyone have any idea why my tree vanishes? Why is an abc keystroke
different from an Enter? Why is it happy to run on every keystroke but not
on every third keystroke? Remember I am doing everything inside the
documentChanged method, not handling individual keystrokes.

Thanks for any help
Re: TreeView contents mysteriously vanish [message #187559 is a reply to message #187082] Fri, 30 January 2004 19:09 Go to previous message
Eclipse UserFriend
Originally posted by: roger.senanque.co.nz

Well, I just found the renegade setRedraw(false) which, when removed,
fixed the problem. I'm still a bit mystified why the Enter didn't cause a
problem but the other keys did, but possibly because the editor had to
scroll there was more going on in the UI thread which masked the problem
there (just a theory).

Anyway, I no longer have a problem. I hope I haven't wasted anyone's time

Roger
Previous Topic:Changing default line delimiter
Next Topic:Accessing Annotation for CVSFile entry
Goto Forum:
  


Current Time: Sun Jul 20 16:58:29 EDT 2025

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

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

Back to the top