private int findItemNumber ( ) { ElementBox parent = getParent ( ) ; int cnt = 0 ; for ( int i = parent . getStartChild ( ) ; i < parent . getEndChild ( ) ; i ++ ) { Box child = parent . getSubBox ( i ) ; if ( child instanceof ListItemBox ) cnt ++ ; if ( child == this ) return cnt ; } return 1 ; }
Finds the item number . Currently this correspond to the number of list - item boxes before this box within the parent box .