private static List < Column > getAncestorColumns ( Resource currentResource , Resource rootResource ) { List < Column > columns = new ArrayList <> ( ) ; List < Resource > ancestors = getAncestors ( currentResource , rootResource ) ; for ( int i = 0 ; i < ancestors . size ( ) ; i ++ ) { Resource r = ancestors . get ( i ) ; String activeId ; if ( i < ancestors . size ( ) - 1 ) { activeId = ancestors . get ( i + 1 ) . getPath ( ) ; } else { activeId = currentResource . getPath ( ) ; } Column column = new Column ( ) . columnId ( r . getPath ( ) ) . lazy ( true ) . activeId ( activeId ) ; columns . add ( column ) ; } return columns ; }
Generate column for each ancestor .