1 11 12 package org.eclipse.text.undo; 13 14 import org.eclipse.core.runtime.Assert; 15 16 import org.eclipse.jface.text.IDocument; 17 18 28 public class DocumentUndoEvent { 29 30 34 public static final int ABOUT_TO_UNDO= 1 << 0; 35 36 40 public static final int ABOUT_TO_REDO= 1 << 1; 41 42 45 public static final int UNDONE= 1 << 2; 46 47 50 public static final int REDONE= 1 << 3; 51 52 56 public static final int COMPOUND= 1 << 4; 57 58 59 private IDocument fDocument; 60 61 62 private int fOffset; 63 64 65 private String fText; 66 67 68 private String fPreservedText; 69 70 71 private int fEventType; 72 73 74 private Object fSource; 75 76 86 DocumentUndoEvent(IDocument doc, int offset, String text, String preservedText, int eventType, Object source) { 87 88 Assert.isNotNull(doc); 89 Assert.isTrue(offset >= 0); 90 91 fDocument= doc; 92 fOffset= offset; 93 fText= text; 94 fPreservedText= preservedText; 95 fEventType= eventType; 96 fSource= source; 97 } 98 99 104 public IDocument getDocument() { 105 return fDocument; 106 } 107 108 113 public int getOffset() { 114 return fOffset; 115 } 116 117 122 public String getText() { 123 return fText; 124 } 125 126 131 public String getPreservedText() { 132 return fPreservedText; 133 } 134 135 140 public int getEventType() { 141 return fEventType; 142 } 143 144 149 public Object getSource() { 150 return fSource; 151 } 152 153 159 public boolean isCompound() { 160 return (fEventType & COMPOUND) != 0; 161 } 162 } 163 | Popular Tags |