if (characterCount > 0 && index != currentField) { characterCount = 0; int fieldName = fieldNames[currentField]; setTextField(fieldName, Integer.parseInt(text.getSelectionText()), true); }
if (index != currentField) { commitCurrentField(); }
void selectField(int index) {	if (characterCount > 0 && index != currentField) {		characterCount = 0;		int fieldName = fieldNames[currentField];		setTextField(fieldName, Integer.parseInt(text.getSelectionText()), true);	}		final int start = fieldIndices[index].x;	final int end = fieldIndices[index].y;	Point pt = text.getSelection();	if (index == currentField && start == pt.x && end == pt.y) return;	currentField = index;	display.asyncExec(new Runnable() {		public void run() {			if (!text.isDisposed()) {				String value = text.getText(start, end - 1);				int s = value.lastIndexOf(' ');				if (s == -1) s = start;				else s = start + s + 1;				text.setSelection(s, end);			}		}	});	}