/** * Ends recording a macro. If this method is called but the text component * is not recording a macro, nothing happens. * * @see #isRecordingMacro() * @see #beginRecordingMacro() */ /* * FIXME: This should throw an exception if we're not recording a macro. */ public static synchronized void endRecordingMacro() { if (!isRecordingMacro()) { //System.err.println("Not recording a macro!"); return; } recordingMacro = false; }
/** * Begins recording a macro. After this method is called, all input/caret * events, etc. are recorded until <code>endMacroRecording</code> is * called. If this method is called but the text component is already * recording a macro, nothing happens (but the macro keeps recording). * * @see #isRecordingMacro() * @see #endRecordingMacro() */ public static synchronized void beginRecordingMacro() { if (isRecordingMacro()) { //System.err.println("Macro already being recorded!"); return; } //JOptionPane.showMessageDialog(this, "Now recording a macro"); if (currentMacro!=null) { currentMacro = null; // May help gc? } currentMacro = new Macro(); recordingMacro = true; }
@Test public void testRecordingMacro_endWhileNotRecording() { Assert.assertFalse(RTextArea.isRecordingMacro()); Assert.assertFalse(RTextArea.isRecordingMacro()); RTextArea.endRecordingMacro(); Assert.assertFalse(RTextArea.isRecordingMacro()); }
@Test public void testRecordingMacro_happyPath() { Assert.assertFalse(RTextArea.isRecordingMacro()); RTextArea.beginRecordingMacro(); Assert.assertTrue(RTextArea.isRecordingMacro()); RTextArea.endRecordingMacro(); Assert.assertFalse(RTextArea.isRecordingMacro()); }
RTextArea textArea = (RTextArea)textComponent; if (RTextArea.isRecordingMacro() && isRecordable()) { int mod = e.getModifiers();
/** * Ends recording a macro. If this method is called but the text component * is not recording a macro, nothing happens. * * @see #isRecordingMacro() * @see #beginRecordingMacro() */ /* * FIXME: This should throw an exception if we're not recording a macro. */ public static synchronized void endRecordingMacro() { if (!isRecordingMacro()) { //System.err.println("Not recording a macro!"); return; } recordingMacro = false; }
/** * Ends recording a macro. If this method is called but the text component * is not recording a macro, nothing happens. * * @see #isRecordingMacro() * @see #beginRecordingMacro() */ /* * FIXME: This should throw an exception if we're not recording a macro. */ public static synchronized void endRecordingMacro() { if (!isRecordingMacro()) { //System.err.println("Not recording a macro!"); return; } recordingMacro = false; }
/** * Ends recording a macro. If this method is called but the text component * is not recording a macro, nothing happens. * * @see #isRecordingMacro() * @see #beginRecordingMacro() */ /* * FIXME: This should throw an exception if we're not recording a macro. */ public static synchronized void endRecordingMacro() { if (!isRecordingMacro()) { //System.err.println("Not recording a macro!"); return; } recordingMacro = false; }
/** * Begins recording a macro. After this method is called, all input/caret * events, etc. are recorded until <code>endMacroRecording</code> is * called. If this method is called but the text component is already * recording a macro, nothing happens (but the macro keeps recording). * * @see #isRecordingMacro() * @see #endRecordingMacro() */ public static synchronized void beginRecordingMacro() { if (isRecordingMacro()) { //System.err.println("Macro already being recorded!"); return; } //JOptionPane.showMessageDialog(this, "Now recording a macro"); if (currentMacro!=null) currentMacro = null; // May help gc? currentMacro = new Macro(); recordingMacro = true; }
/** * Begins recording a macro. After this method is called, all input/caret * events, etc. are recorded until <code>endMacroRecording</code> is * called. If this method is called but the text component is already * recording a macro, nothing happens (but the macro keeps recording). * * @see #isRecordingMacro() * @see #endRecordingMacro() */ public static synchronized void beginRecordingMacro() { if (isRecordingMacro()) { //System.err.println("Macro already being recorded!"); return; } //JOptionPane.showMessageDialog(this, "Now recording a macro"); if (currentMacro!=null) currentMacro = null; // May help gc? currentMacro = new Macro(); recordingMacro = true; }
/** * Begins recording a macro. After this method is called, all input/caret * events, etc. are recorded until <code>endMacroRecording</code> is * called. If this method is called but the text component is already * recording a macro, nothing happens (but the macro keeps recording). * * @see #isRecordingMacro() * @see #endRecordingMacro() */ public static synchronized void beginRecordingMacro() { if (isRecordingMacro()) { //System.err.println("Macro already being recorded!"); return; } //JOptionPane.showMessageDialog(this, "Now recording a macro"); if (currentMacro!=null) { currentMacro = null; // May help gc? } currentMacro = new Macro(); recordingMacro = true; }
RTextArea textArea = (RTextArea)textComponent; if (RTextArea.isRecordingMacro() && isRecordable()) { int mod = e.getModifiers();
RTextArea textArea = (RTextArea)textComponent; if (RTextArea.isRecordingMacro() && isRecordable()) { int mod = e.getModifiers();
RTextArea textArea = (RTextArea)textComponent; if (RTextArea.isRecordingMacro() && isRecordable()) { int mod = e.getModifiers();