@Override public void stateChanged( ChangeEvent e ) { if( isPaused() ) { return; } if( _undoMgr.getUndoAtom() == newUndoAdtom ) { // End the Script Change undo atom/batch. // Since this ScriptChangeHandler isPaused() while script change undo items are added // to the undo mgr, we assume some other undo change happened which should terminate // the script change _undoMgr.removeChangeListener( this ); _undoMgr.endUndoAtom(); } else if( !newUndoAdtom.isInProgress() ) { _undoMgr.removeChangeListener( this ); } } } );
@Override public void stateChanged( ChangeEvent e ) { if( isPaused() ) { return; } if( _undoMgr.getUndoAtom() == newUndoAdtom ) { // End the Script Change undo atom/batch. // Since this ScriptChangeHandler isPaused() while script change undo items are added // to the undo mgr, we assume some other undo change happened which should terminate // the script change _undoMgr.removeChangeListener( this ); _undoMgr.endUndoAtom(); } else if( !newUndoAdtom.isInProgress() ) { _undoMgr.removeChangeListener( this ); } } } );
if (! TextArea.highlight) { if (TextArea.newedit) { if (TextArea.compoundEdit.isInProgress()) TextArea.compoundEdit.end(); TextArea.compoundEdit = new CompoundEdit(); TextArea.undo.addEdit(TextArea.compoundEdit); } else if (! TextArea.compoundEdit.isInProgress()) { TextArea.compoundEdit = new CompoundEdit(); TextArea.undo.addEdit(TextArea.compoundEdit);