private void updateRatingChoice(){
  int current=m_chRating.getSelectedIndex();
  m_chRating.removeAllItems();
  FactionRecord fRec=(FactionRecord)m_chSubfaction.getSelectedItem();
  if (fRec == null) {
    fRec=(FactionRecord)m_chFaction.getSelectedItem();
  }
  ArrayList<String> ratingLevels=fRec.getRatingLevels();
  if (ratingLevels.isEmpty()) {
    ratingLevels=fRec.getRatingLevelSystem();
  }
  if (ratingLevels.size() > 1) {
    for (int i=ratingLevels.size() - 1; i >= 0; i--) {
      m_chRating.addItem(ratingLevels.get(i));
    }
  }
  if (current < 0 && m_chRating.getItemCount() > 0) {
    m_chRating.setSelectedIndex(0);
  }
 else {
    m_chRating.setSelectedIndex(Math.min(current,m_chRating.getItemCount() - 1));
  }
}

private void updateRatingChoice ( ) { int current = m_chRating . getSelectedIndex ( ) ; m_chRating . removeAllItems ( ) ; FactionRecord fRec = ( FactionRecord ) m_chSubfaction . getSelectedItem ( ) ; if ( fRec == null ) { fRec = ( FactionRecord ) m_chFaction . getSelectedItem ( ) ; } ArrayList < String > ratingLevels = fRec . getRatingLevels ( ) ; if ( ratingLevels . isEmpty ( ) ) { ratingLevels = fRec . getRatingLevelSystem ( ) ; } if ( ratingLevels . size ( ) > 1 ) { for ( int i = ratingLevels . size ( ) - 1 ; i >= 0 ; i -- ) { m_chRating . addItem ( ratingLevels . get ( i ) ) ; } } if ( current < 0 && m_chRating . getItemCount ( ) > 0 ) { m_chRating . setSelectedIndex ( 0 ) ; } else { m_chRating . setSelectedIndex ( Math . min ( current , m_chRating . getItemCount ( ) - 1 ) ) ; } }
when faction or subfaction is changed , refresh ratings combo box with appropriate values for selected faction .
