Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Refresh issue in View extending CommonNavigator(Refresh in the data model not reflecting in the tree)
Refresh issue in View extending CommonNavigator [message #891245] Sun, 24 June 2012 12:17 Go to next message
Aravindhan Annamalai is currently offline Aravindhan AnnamalaiFriend
Messages: 89
Registered: July 2009
Location: Chennai
Member
I am using a view which extends CommonNavigator,

The view provides a Tree Viewer which is constructed using our model objects

I have a wizard which adds a new object to the tree,

How do I refresh the tree viewer to expand and set the selection on the newly created object?

Re: Refresh issue in View extending CommonNavigator [message #891525 is a reply to message #891245] Mon, 25 June 2012 07:22 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi Aravindhan,

I would try to call
AbstractTreeViewer.add(Object parentElementOrTreePath, Object childElement)
from my content provider and then
TreeViewer.setSelection(new StructuredSelection(childElement), true)
Re: Refresh issue in View extending CommonNavigator [message #1401883 is a reply to message #891525] Wed, 16 July 2014 07:53 Go to previous message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi Aravindhan,

You must call TreeViewer.refresh() to refresh the viewer completely with information freshly obtained from this viewer's model and call TreeViewer.refresh(element) to refresh the viewer starting with the given element.

You must avoid the use of the method AbstractTreeViewer.add(Object parentElementOrTreePath, Object childElement) because it will not be synchronized with your data model.

Kind Regards,

Hussein


ALL4TEC
Previous Topic:[Databind] Decorate elements of a JFace viewer (table, tree, ...)
Next Topic:CNF, tree refresh problem
Goto Forum:
  


Current Time: Thu Apr 25 19:01:26 GMT 2024

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

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

Back to the top