Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer refresh/update specific TreeColumn(Solution or code review)
TreeViewer refresh/update specific TreeColumn [message #923992] Wed, 26 September 2012 11:37 Go to next message
Lorand Lorincz is currently offline Lorand LorinczFriend
Messages: 35
Registered: April 2011
Member
Hello everybody,

Is there any way to refresh/update just a specific TreeColumn in a TreeViewer? I currently have a feature in my TreeViewer that cand hide/show a TreeColumn. When a column is hidden, the values for that column can go out of sync with my Model. Thats why I need to refresh to Column when I enable it again and the operation of getting the value for cells of the column is very expensive.

I have a solution but I'm hoping that there is a better solution (maybe something out-of-the-box). I managed to define my LabelProvider as an Inner Class in the class that contains the TreeViewer (CustomTreeView extends ViewPart). CustomTreeView will have the method update(TreeColumn) which will:
1.store the TreeColumn in a private field of the inline LabelProvider class.
2.call TreeViewer.refresh()
3.set the TreeColumn field of the inner LabelProvider to null.
The update(ViewerCell cell) method of the LabelProvider will check if the ViewerCell belongs to the TreeColumn stored in the LabelProvider and refresh it if needed.

What do you think of this solution?

Also are the developers of the jface planing to add such a functionality out of the box? Overloading the refresh method of the TreeViewer with a properties Object and propagating it to update(ViewerCell cell, Object properties) of the LabelProvider i think would be very helpfull.

Thanks in advance
Re: TreeViewer refresh/update specific TreeColumn [message #1272580 is a reply to message #923992] Tue, 18 March 2014 08:47 Go to previous messageGo to next message
Pramod Mising name is currently offline Pramod Mising nameFriend
Messages: 7
Registered: July 2012
Junior Member
Hi,

I am also trying to implement same thing. Please let me know did you got solution for the same.

Thanks in advance.


Regards,
Pramod
Re: TreeViewer refresh/update specific TreeColumn [message #1425367 is a reply to message #1272580] Wed, 17 September 2014 07:55 Go to previous message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi,

To hide a column, you need just to call TreeColumn#dispose() (you don't need to call TreeViewer#refresh()).

When you display a new column, currently there are no other solution than calling TreeViewer#refresh() (a refresh by column doesn't exist).

Regards,

Hussein


ALL4TEC
Previous Topic:[DataBinding] Xtext EMF EDB Implementation, help needed with List & observeDetails()
Next Topic:add Dynamic Data to ComBoboxCellEditor
Goto Forum:
  


Current Time: Thu Apr 25 20:01:36 GMT 2024

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

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

Back to the top