private static void wire(String call, Field field, BindingContext context)
throws SecurityException, NoSuchMethodException, IllegalArgumentException,
IllegalAccessException, InvocationTargetException {
Method aalMethod = field.getType().getMethod("addActionListener", ActionListener.class);
Object actionObject = context.getFieldObject(field, Object.class);
final ObjectFieldMethod ofm = context.getBindableMethod(call);
if (ofm == null) {
throw new BindingException("could not find bindable method: " + call);
}
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
boolean accessible = ofm.getMethod().isAccessible();
ofm.getMethod().setAccessible(true);
ofm.getMethod().invoke(ofm.getObject());
ofm.getMethod().setAccessible(accessible);
} catch (InvocationTargetException itex) {
logger.error("exception during action firing", itex.getCause());
} catch (Exception ex) {
logger.error("exception during action firing", ex);
}