Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TreeViewer:can't update children TreeItems(i have a problem when i modify a TreeItem,i can't update it's children at the same time,who can help me? thanks)
TreeViewer:can't update children TreeItems [message #530710] Fri, 30 April 2010 15:15
pororo1985  is currently offline pororo1985 Friend
Messages: 1
Registered: April 2010
Junior Member
i have a treeviewer ,and also set a ICellModifier for it。
in the ICellModifier:
public void modify(Object element, String property, Object value) {	
             //modify and update element
             ........

		if(element instanceof TreeItem){
			TreeItem item = (TreeItem) element;
		        if(property.equals("key1")){
				if(!item.getData().getChildren().isEmpty()){
                                      for(...){
                                         item.getData().getChildren().get(i).setValue(value);                                         
                                      }		
                                 treeViewer.update(element , null);
				}
			}
		}
	}


now when i modifyed the TreeItem , it's data and it has be modify and updated,but it's Children has not be modify , and Children 's data has be modify,In other words,the TreeItem 's Children not change in the viewer,but data changed.
and if i select the a TreeItem 's child now, it will change to the value what it should be.

so ,who can tell me ,why it happend like this?i have update the element,so the treeViewer should also update it's Children ,isn't it ? and how to repair it?

it's very very very to thank u.
Previous Topic:[TreeViewer] [EMF] [Databinding] [Inplace editing]
Next Topic:TableViewer - DoubleClick events for column
Goto Forum:
  


Current Time: Sat Apr 27 05:12:36 GMT 2024

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

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

Back to the top