home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import com.sun.java.swing.undo.AbstractUndoableEdit;
- import com.sun.java.swing.undo.CannotRedoException;
- import com.sun.java.swing.undo.CannotUndoException;
- import java.util.Vector;
-
- class StringContent$InsertUndo extends AbstractUndoableEdit {
- // $FF: synthetic field
- StringContent this$0;
- protected int offset;
- protected int length;
- protected String string;
- protected Vector posRefs;
-
- // $FF: synthetic method
- protected StringContent$InsertUndo(StringContent this$0, int offset, int length) {
- this.this$0 = this$0;
- this.offset = offset;
- this.length = length;
- }
-
- public void undo() throws CannotUndoException {
- super.undo();
-
- try {
- synchronized(this.this$0){}
-
- try {
- if (this.this$0.marks != null) {
- this.posRefs = this.this$0.getPositionsInRange((Vector)null, this.offset, this.length);
- }
-
- this.string = this.this$0.getString(this.offset, this.length);
- this.this$0.remove(this.offset, this.length);
- } catch (Throwable var4) {
- throw var4;
- }
-
- } catch (BadLocationException var5) {
- throw new CannotUndoException();
- }
- }
-
- public void redo() throws CannotRedoException {
- super.redo();
-
- try {
- synchronized(this.this$0){}
-
- try {
- this.this$0.insertString(this.offset, this.string);
- this.string = null;
- if (this.posRefs != null) {
- this.this$0.updateUndoPositions(this.posRefs);
- this.posRefs = null;
- }
- } catch (Throwable var4) {
- throw var4;
- }
-
- } catch (BadLocationException var5) {
- throw new CannotRedoException();
- }
- }
- }
-