private static void wire(final OnChange change, Field field, BindingContext context)
throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
String call = change.call();
if (call == null) {
throw new BindingException("call on @OnChange on " + field.getName() + " must be specified");
}
Method _adjustMethod = null;
try {
_adjustMethod = field.getType().getMethod("getValueIsAdjusting");
} catch(NoSuchMethodException nsme) {
// not a problem, leave value as null;
}
final Method adjustMethod = _adjustMethod;
final Method addChangeMethod = field.getType().getMethod("addChangeListener", ChangeListener.class);
if (addChangeMethod != null) {
final Object changeObject = context.getFieldObject(field, Object.class);
final ObjectFieldMethod ofm = context.getBindableMethod(call);
if (ofm == null) {
throw new BindingException("could not find bindable method: " + call);
}
final ChangeListener changeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
try {
if (adjustMethod != null && !change.onAdjust()) {