public void group ( TreeTableColumn < S , ? > ... treeTableColumns ) { try { lock . lock ( ) ; // init groups map if ( groupOrder . size ( ) == 0 ) { groups = new HashMap <> ( ) ; } try { if ( originalRoot == null ) { originalRoot = getRoot ( ) ; } for ( TreeTableColumn < S , ? > treeTableColumn : treeTableColumns ) { if ( groupOrder . contains ( treeTableColumn ) ) { continue ; } groups = group ( treeTableColumn , groups , null , ( RecursiveTreeItem < S > ) originalRoot ) ; } groupOrder . addAll ( treeTableColumns ) ; // update table ui buildGroupedRoot ( groups , null , 0 ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } finally { lock . unlock ( ) ; } }
this is a blocking method so it should not be called from the ui thread it will regroup the tree table view