/** * {@inheritDoc} */ @Override public void redoLastAction() { super.redoLastAction(); // Occasionally marked occurrences' Positions are in invalid states // due to how javax.swing.text.AbstractDocument tracks the start and // end offsets. This is usually not needed, but can be when the last // token in the Document is a marked occurrence, and an undo or redo // occurs which clears most of the document text. In that case it is // possible for the end Position to be reset to something small, but // the start offset to be its prior valid (start > end). ((RSyntaxTextAreaHighlighter)getHighlighter()). clearMarkOccurrencesHighlights(); }
@Override public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { if (textArea.isEnabled() && textArea.isEditable()) { textArea.redoLastAction(); textArea.requestFocusInWindow(); } }
@Test public void testCanRedo() { RTextArea textArea = new RTextArea(); Assert.assertFalse(textArea.canRedo()); textArea.replaceSelection("Hi"); Assert.assertFalse(textArea.canRedo()); textArea.undoLastAction(); Assert.assertTrue(textArea.canRedo()); textArea.redoLastAction(); Assert.assertFalse(textArea.canRedo()); }
/** * {@inheritDoc} */ @Override public void redoLastAction() { super.redoLastAction(); // Occasionally marked occurrences' Positions are in invalid states // due to how javax.swing.text.AbstractDocument tracks the start and // end offsets. This is usually not needed, but can be when the last // token in the Document is a marked occurrence, and an undo or redo // occurs which clears most of the document text. In that case it is // possible for the end Position to be reset to something small, but // the start offset to be its prior valid (start > end). ((RSyntaxTextAreaHighlighter)getHighlighter()). clearMarkOccurrencesHighlights(); }
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { if (textArea.isEnabled() && textArea.isEditable()) { textArea.redoLastAction(); textArea.requestFocusInWindow(); } }
@Override public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { if (textArea.isEnabled() && textArea.isEditable()) { textArea.redoLastAction(); textArea.requestFocusInWindow(); } }
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { if (textArea.isEnabled() && textArea.isEditable()) { textArea.redoLastAction(); textArea.requestFocusInWindow(); } }