Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Outline View (Tree Update of Folded and Unfolded Nodes)
Outline View (Tree Update of Folded and Unfolded Nodes) [message #894793] Tue, 10 July 2012 14:33
Marcel Austenfeld is currently offline Marcel AustenfeldFriend
Messages: 160
Registered: July 2009
Senior Member
I have an Outline view in my application which is updated by an editor.
At the moment each time the editor is updated the Outline view is redrawn.
The problem is that each time a redraw event occurs all nodes of the Tree implementation are expanded, too. I would rather prefer that unfolded Tree nodes stay unfolded if a redraw event occurs. I tried to use:

Object[] expanded = contentOutlineViewer.getExpandedElements();

and after

viewer.setExpandedElements(elements);

but that didn't works with expanded or folded tree nodes

Here is my base implementation:

public void outlineInputChanged(ClassModel classModelOld, ClassModel classModelNew) {

		if (contentOutlineViewer != null) {

			TreeViewer viewer = contentOutlineViewer;

			if (viewer != null) {
				Control control = viewer.getControl();
				if (control != null && !control.isDisposed()) {

					control.setRedraw(false);

					viewer.setInput(classModelNew);
					viewer.expandAll();

					control.setRedraw(true);
				}
			}
		}



Is there any solution to store the expanded and folded tree elements and restore them after a redraw event?

Any help is appreciated.
Previous Topic:error creating a JPA project
Next Topic:Debugging Debug code
Goto Forum:
  


Current Time: Thu Apr 25 00:23:19 GMT 2024

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

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

Back to the top