File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JFace TreeViewer Databinding: Tree not reflecting changes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFace TreeViewer Databinding: Tree not reflecting changes" Watch "JFace TreeViewer Databinding: Tree not reflecting changes" New topic
Author

JFace TreeViewer Databinding: Tree not reflecting changes

Blue Job
Greenhorn

Joined: Jun 17, 2013
Posts: 2
I have a tree which displays like this:

The tree displays correctly but the problem is, when I add an item, the tree does not update/refresh automatically. I still need to explicitly call the refresh() function (See creating the tree part). The model and the tree should be in sync right? The changes should appear in the tree automatically, no need to explicitly call refresh().

I think the problem is in the second parameter of ViewerSupport.bind(), the object input:

Creating the tree:

Models:
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

Welcome to the Ranch.
Have you gone through http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#dynamic


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Blue Job
Greenhorn

Joined: Jun 17, 2013
Posts: 2
I'm sorry I forgot to specify that I'm talking about JFace TreeViewer and what I am trying to achieve here is bidirectional databinding.

It's GUI stuff, but did I post this in a wrong place?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

No you posted in the correct forum. However we do not see much activity besides Swing.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

Please take action on the PM I had sent. It is not optional.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFace TreeViewer Databinding: Tree not reflecting changes
 
Similar Threads
Form a tree parent -childs from String
synchronizing getters/setters
core java
notification when a public attribute value changes
Retrieve Node of tree in next page using jsp, struts tiles, Dojo