@ SuppressWarnings ( "checkstyle:parameternumber" ) private void calcChildrenRowIds ( final List < RowIdWrapper > rows , final RowIdWrapper row , final TableModel model , final RowIdWrapper parent , final Set < ? > expanded , final ExpandMode mode , final boolean forUpdate , final boolean editable ) { // Add row rows . add ( row ) ; // Add to parent if ( parent != null ) { parent . addChild ( row ) ; } List < Integer > rowIndex = row . getRowIndex ( ) ; // If row has a renderer, then dont need to process its children (should not have any anyway as it is a "leaf") if ( model . getRendererClass ( rowIndex ) != null ) { return ; } // Check row is expandable if ( ! model . isExpandable ( rowIndex ) ) { return ; } // Check has children if ( ! model . hasChildren ( rowIndex ) ) { return ; } row . setHasChildren ( true ) ; // Always add children if CLIENT mode or row is expanded boolean addChildren = ( mode == ExpandMode . CLIENT ) || ( expanded != null && expanded . contains ( row . getRowKey ( ) ) ) ; if ( ! addChildren ) { return ; } // Get actual child count int children = model . getChildCount ( rowIndex ) ; if ( children == 0 ) { // Could be there are no children even though hasChildren returned true row . setHasChildren ( false ) ; return ; } // Render mode, Keep rows that have been expanded (only if table editable) if ( ! forUpdate && editable ) { addPrevExpandedRow ( row . getRowKey ( ) ) ; } // Add children by processing each child row for ( int i = 0 ; i < children ; i ++ ) { // Add next level List < Integer > nextRow = new ArrayList <> ( row . getRowIndex ( ) ) ; nextRow . add ( i ) ; // Create Wrapper Object key = model . getRowKey ( nextRow ) ; RowIdWrapper wrapper = new RowIdWrapper ( nextRow , key , row ) ; calcChildrenRowIds ( rows , wrapper , model , row , expanded , mode , forUpdate , editable ) ; } }
Calculate the row ids of a row s children .