1 9 10 package org.netbeans.modules.form.fakepeer; 11 12 import java.lang.reflect.InvocationHandler ; 13 import java.lang.reflect.Method ; 14 import org.openide.ErrorManager; 15 16 23 public class FakePeerInvocationHandler implements InvocationHandler { 24 25 private final FakeComponentPeer comp; 26 27 30 public FakePeerInvocationHandler (FakeComponentPeer comp) { 31 this.comp = comp; 32 } 33 34 37 public Object invoke(Object proxy, Method method, Object [] args) 38 throws Throwable { 39 40 try { 41 42 Class [] parameters = method.getParameterTypes(); 43 Method thisMethod = comp.getClass().getMethod(method.getName(), parameters); 44 return thisMethod.invoke(comp, args); 45 46 56 57 } catch (Exception e) { 58 ErrorManager.getDefault().notify(e); 59 throw e; 60 } 61 62 } 63 64 } 65 | Popular Tags |