aspose 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
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: 9990
    
    7

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: 9990
    
    7

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: 9990
    
    7

Please take action on the PM I had sent. It is not optional.
 
jQuery in Action, 2nd edition
 
subject: JFace TreeViewer Databinding: Tree not reflecting changes
 
Similar Threads
Retrieve Node of tree in next page using jsp, struts tiles, Dojo
notification when a public attribute value changes
core java
Form a tree parent -childs from String
synchronizing getters/setters