private void historyAddChanged(){
  if (historyTextEdited) {
    historyAdd(getText());
    historyTextEdited=false;
    historyPosition=history.size();
  }
}

private void historyAddChanged ( ) { if ( historyTextEdited ) { historyAdd ( getText ( ) ) ; historyTextEdited = false ; historyPosition = history . size ( ) ; } }
adds the current text to the history , if it was changed .
