private static void wire(final OnClick onClick, Field field, BindingContext context)
throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
String call = onClick.call();
if (call == null) {
throw new BindingException("call on @OnClick on " + field.getName() + " must be specified");
}
Method amlMethod = field.getType().getMethod("addMouseListener", MouseListener.class);
if (amlMethod != null) {
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);
}
MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() != onClick.button().getConstant() || e.getClickCount() != onClick.count()) {