public void columnAdded(TableColumnModelEvent e){
  LimeTableColumn addedColumn=getToColumn(e);
  LimeTableColumn ltc=addedColumn;
  setVisibility(ltc,true);
  TableColumnModel tcm=table.getColumnModel();
  int order=getOrder(ltc);
  int current=tcm.getColumnIndex(ltc.getId());
  int max=tcm.getColumnCount();
  if (order != current) {
    stopListening();
    order=Math.min(order,max - 1);
    tcm.moveColumn(current,order);
    for (current=order + 1; current < max; current++) {
      ltc=(LimeTableColumn)tcm.getColumn(current);
      setOrder(ltc,current);
    }
    for (Iterator<LimeTableColumn> i=table.getHiddenColumns(); i.hasNext(); ) {
      ltc=i.next();
      current=getOrder(ltc);
      if (current > order)       setOrder(ltc,current + 1);
    }
    startListening();
  }
  if (listener != null)   listener.columnAdded(addedColumn,table);
  save();
}

public void columnAdded ( TableColumnModelEvent e ) { LimeTableColumn addedColumn = getToColumn ( e ) ; LimeTableColumn ltc = addedColumn ; setVisibility ( ltc , true ) ; TableColumnModel tcm = table . getColumnModel ( ) ; int order = getOrder ( ltc ) ; int current = tcm . getColumnIndex ( ltc . getId ( ) ) ; int max = tcm . getColumnCount ( ) ; if ( order != current ) { stopListening ( ) ; order = Math . min ( order , max - 1 ) ; tcm . moveColumn ( current , order ) ; for ( current = order + 1 ; current < max ; current ++ ) { ltc = ( LimeTableColumn ) tcm . getColumn ( current ) ; setOrder ( ltc , current ) ; } for ( Iterator < LimeTableColumn > i = table . getHiddenColumns ( ) ; i . hasNext ( ) ; ) { ltc = i . next ( ) ; current = getOrder ( ltc ) ; if ( current > order ) setOrder ( ltc , current + 1 ) ; } startListening ( ) ; } if ( listener != null ) listener . columnAdded ( addedColumn , table ) ; save ( ) ; }
triggered from a column being added . the ' to ' index of the tablecolumnmodelevent is the index in the tablecolumn of the newly added column .
