/** * Starts interpretation of the next field: - It computes which is the next field to be * interpreted - It starts its interpretation (see interpretCurrentField) * * <p>CHANGED WITH RESPECT TO FORMFILLLIB (chapter 5) Changes: - Computation of next field is * circular: after the last one, it comes the first one. - endOfDialog = true when all fields are * filled */ private void moveToNextField() { // The position of the field to be interpreted (currentPosition) is moved forward // until either the field is not filled or there are no more fields to visit (endOfDialog is // true) Boolean endOfDialog = false; while (form.getField(currentPosition).isFilled() && !endOfDialog) { currentPosition = (currentPosition + 1) % form.numberOfFields(); if (form.allFieldsFilled()) { endOfDialog = true; currentPosition = 0; } } // If the end of the dialogue is reached, the results are processed if (endOfDialog) { processDialogResults(result); } else // If not, then it interprets the next field interpretCurrentField(); }
// TODO public void clearAllFields() { for (int i = 0; i < form.numberOfFields(); i++) form.getField(i).setValue(null); }