1 11 12 package org.eclipse.jface.text; 13 14 import org.eclipse.core.runtime.Assert; 15 16 17 25 public class DocumentEvent { 26 27 34 private static final boolean ASSERT_TEXT_NOT_NULL= Boolean.getBoolean("org.eclipse.text/debug/DocumentEvent/assertTextNotNull"); 36 37 public IDocument fDocument; 38 39 public int fOffset; 40 41 public int fLength; 42 43 public String fText= ""; 48 public long fModificationStamp; 49 50 58 public DocumentEvent(IDocument doc, int offset, int length, String text) { 59 60 Assert.isNotNull(doc); 61 Assert.isTrue(offset >= 0); 62 Assert.isTrue(length >= 0); 63 64 if (ASSERT_TEXT_NOT_NULL) 65 Assert.isNotNull(text); 66 67 fDocument= doc; 68 fOffset= offset; 69 fLength= length; 70 fText= text; 71 72 if (fDocument instanceof IDocumentExtension4) 73 fModificationStamp= ((IDocumentExtension4)fDocument).getModificationStamp(); 74 else 75 fModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP; 76 } 77 78 81 public DocumentEvent() { 82 } 83 84 89 public IDocument getDocument() { 90 return fDocument; 91 } 92 93 98 public int getOffset() { 99 return fOffset; 100 } 101 102 107 public int getLength() { 108 return fLength; 109 } 110 111 116 public String getText() { 117 return fText; 118 } 119 120 128 public long getModificationStamp() { 129 return fModificationStamp; 130 } 131 } 132 | Popular Tags |