/** * This method is made final here as there's an important processing that * must be done before the real action functionality is performed. It can * include the following: 1. Updating of the target component depending on * the update mask given in action constructor. 2. Possible macro recoding * when the macro recording is turned on. The real action functionality * should be done in the method actionPerformed(ActionEvent evt, * JTextComponent target) which must be redefined by the target action. */ public final void actionPerformed(ActionEvent evt) { JTextComponent target = getTextComponent(evt); if (recording && 0 == (updateMask & NO_RECORDING)) { recordAction(target, evt); } updateComponent(target); actionPerformed(evt, target); }
/** This method is made final here as there's an important * processing that must be done before the real action * functionality is performed. It can include the following: * 1. Updating of the target component depending on the update * mask given in action constructor. * 2. Possible macro recoding when the macro recording * is turned on. * The real action functionality should be done in * the method actionPerformed(ActionEvent evt, JTextComponent target) * which must be redefined by the target action. */ public final void actionPerformed(final ActionEvent evt) { final JTextComponent target = getTextComponent(evt); if( recording && 0 == (updateMask & NO_RECORDING) ) { recordAction( target, evt ); } updateComponent(target); if (asynchonous()) { RequestProcessor.getDefault().post(new Runnable () { public void run() { actionPerformed(evt, target); } }); } else { actionPerformed(evt, target); } }