public void updateRootTypes ( ModelNode address , List < ModelNode > modelNodes ) { deck . showWidget ( CHILD_VIEW ) ; tree . clear ( ) ; descView . clearDisplay ( ) ; formView . clearDisplay ( ) ; offsetDisplay . clear ( ) ; // IMPORTANT: when pin down is active, we need to consider the offset to calculate the real address addressOffset = address ; nodeHeader . updateDescription ( address ) ; List < Property > offset = addressOffset . asPropertyList ( ) ; if ( offset . size ( ) > 0 ) { String parentName = offset . get ( offset . size ( ) - 1 ) . getName ( ) ; HTML parentTag = new HTML ( "<div class='gwt-ToggleButton gwt-ToggleButton-down' title='Remove Filter'>&nbsp;" + parentName + "&nbsp;<i class='icon-remove'></i></div>" ) ; parentTag . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { presenter . onPinTreeSelection ( null ) ; } } ) ; offsetDisplay . add ( parentTag ) ; } TreeItem rootItem = null ; String rootTitle = null ; String key = null ; if ( address . asList ( ) . isEmpty ( ) ) { rootTitle = DEFAULT_ROOT ; key = DEFAULT_ROOT ; } else { List < ModelNode > tuples = address . asList ( ) ; rootTitle = tuples . get ( tuples . size ( ) - 1 ) . asProperty ( ) . getValue ( ) . asString ( ) ; key = rootTitle ; } SafeHtmlBuilder html = new SafeHtmlBuilder ( ) . appendEscaped ( rootTitle ) ; rootItem = new ModelTreeItem ( html . toSafeHtml ( ) , key , address , false ) ; tree . addItem ( rootItem ) ; deck . showWidget ( RESOURCE_VIEW ) ; rootItem . setSelected ( true ) ; currentRootKey = key ; addChildrenTypes ( ( ModelTreeItem ) rootItem , modelNodes ) ; }
Update root node . Basicaly a refresh of the tree .