/** * Registers a callback method when the Action corresponding to * the action id is invoked. When a Component that was constructed from the * Action identified by the action id invokes actionPerformed then the method * named will be invoked on the handler Object. * <p> * If the Action represented by the action id is a StateChangeAction, then * the method passed should take an int as an argument. The value of * getStateChange() on the ItemEvent object will be passed as the parameter. * * @param handler the object which will be perform the action * @param method the name of the method on the handler which will be called. */ public void registerCallback(Object handler, String method) { if (isStateAction()) { // Create a handler for toggle type actions. addItemListener(new BooleanInvocationHandler(handler, method)); } else { // Create a new ActionListener using the dynamic proxy API. addActionListener(EventHandler.create(ActionListener.class, handler, method)); } }
/** * Registers a callback method when the Action corresponding to * the action id is invoked. When a Component that was constructed from the * Action identified by the action id invokes actionPerformed then the method * named will be invoked on the handler Object. * <p> * If the Action represented by the action id is a StateChangeAction, then * the method passed should take an int as an argument. The value of * getStateChange() on the ItemEvent object will be passed as the parameter. * * @param handler the object which will be perform the action * @param method the name of the method on the handler which will be called. */ public void registerCallback(Object handler, String method) { if (isStateAction()) { // Create a handler for toggle type actions. addItemListener(new BooleanInvocationHandler(handler, method)); } else { // Create a new ActionListener using the dynamic proxy API. addActionListener(EventHandler.create(ActionListener.class, handler, method)); } }
/** * Registers a callback method when the Action corresponding to * the action id is invoked. When a Component that was constructed from the * Action identified by the action id invokes actionPerformed then the method * named will be invoked on the handler Object. * <p> * If the Action represented by the action id is a StateChangeAction, then * the method passed should take an int as an argument. The value of * getStateChange() on the ItemEvent object will be passed as the parameter. * * @param handler the object which will be perform the action * @param method the name of the method on the handler which will be called. */ public void registerCallback(Object handler, String method) { if (isStateAction()) { // Create a handler for toogle type actions. addItemListener(new BooleanInvocationHandler(handler, method)); } else { // Create a new ActionListener using the dynamic proxy api. addActionListener((ActionListener)EventHandler.create(ActionListener.class, handler, method)); } }
/** * Registers a callback method when the Action corresponding to * the action id is invoked. When a Component that was constructed from the * Action identified by the action id invokes actionPerformed then the method * named will be invoked on the handler Object. * <p> * If the Action represented by the action id is a StateChangeAction, then * the method passed should take an int as an argument. The value of * getStateChange() on the ItemEvent object will be passed as the parameter. * * @param handler the object which will be perform the action * @param method the name of the method on the handler which will be called. */ public void registerCallback(Object handler, String method) { if (isStateAction()) { // Create a handler for toggle type actions. addItemListener(new BooleanInvocationHandler(handler, method)); } else { // Create a new ActionListener using the dynamic proxy API. addActionListener(EventHandler.create(ActionListener.class, handler, method)); } }