2 * Created on 28.04.2003
5 package net.sourceforge.phpeclipse.phpeditor.php.test;
7 import org.eclipse.jface.text.BadLocationException;
8 import org.eclipse.jface.text.BadPositionCategoryException;
9 import org.eclipse.jface.text.Document;
10 import org.eclipse.jface.text.IDocumentListener;
11 import org.eclipse.jface.text.IDocumentPartitioner;
12 import org.eclipse.jface.text.IDocumentPartitioningListener;
13 import org.eclipse.jface.text.IPositionUpdater;
14 import org.eclipse.jface.text.IRegion;
15 import org.eclipse.jface.text.ITypedRegion;
16 import org.eclipse.jface.text.Position;
19 * Mockobject for Testing.
21 * @author Stefan Langer
22 * @version $Revision: 1.3 $
24 public class DummyDocument extends Document // implements IDocument
26 private char[] fTextBuffer;
31 * @see org.eclipse.jface.text.IDocument#getChar(int)
33 public char getChar(int offset) throws BadLocationException {
34 if (offset >= 0 && offset < fTextBuffer.length)
35 return fTextBuffer[offset];
37 throw new BadLocationException("Offset out of range!");
43 * @see org.eclipse.jface.text.IDocument#getLength()
45 public int getLength() {
46 return fTextBuffer.length;
52 * @see org.eclipse.jface.text.IDocument#get()
55 return String.copyValueOf(fTextBuffer);
61 * @see org.eclipse.jface.text.IDocument#get(int, int)
63 public String get(int offset, int length) throws BadLocationException {
64 if (offset >= 0 && (offset + length) < fTextBuffer.length)
65 return String.copyValueOf(fTextBuffer, offset, length);
67 throw new BadLocationException("Out of range!");
73 * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
75 public void set(String text) {
76 fTextBuffer = text.toCharArray();
82 * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
84 public void replace(int offset, int length, String text)
85 throws BadLocationException {
86 throw new UnsupportedOperationException("Not implemented!");
92 * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
94 public void addDocumentListener(IDocumentListener listener) {
95 throw new UnsupportedOperationException("Not implemented!");
101 * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
103 public void removeDocumentListener(IDocumentListener listener) {
104 throw new UnsupportedOperationException("Not implemented!");
110 * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
112 public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
113 throw new UnsupportedOperationException("Not implemented!");
119 * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
121 public void removePrenotifiedDocumentListener(
122 IDocumentListener documentAdapter) {
123 throw new UnsupportedOperationException("Not implemented!");
129 * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
131 // public void addPositionCategory(String category)
133 // throw new UnsupportedOperationException("Not implemented!");
138 * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
140 public void removePositionCategory(String category)
141 throws BadPositionCategoryException {
142 throw new UnsupportedOperationException("Not implemented!");
148 * @see org.eclipse.jface.text.IDocument#getPositionCategories()
150 public String[] getPositionCategories() {
151 throw new UnsupportedOperationException("Not implemented!");
157 * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
159 // public boolean containsPositionCategory(String category)
161 // throw new UnsupportedOperationException("Not implemented!");
166 * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
168 public void addPosition(Position position) throws BadLocationException {
169 throw new UnsupportedOperationException("Not implemented!");
175 * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
177 public void removePosition(Position position) {
178 throw new UnsupportedOperationException("Not implemented!");
184 * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String,
185 * org.eclipse.jface.text.Position)
187 public void addPosition(String category, Position position)
188 throws BadLocationException, BadPositionCategoryException {
189 throw new UnsupportedOperationException("Not implemented!");
195 * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String,
196 * org.eclipse.jface.text.Position)
198 public void removePosition(String category, Position position)
199 throws BadPositionCategoryException {
200 throw new UnsupportedOperationException("Not implemented!");
206 * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
208 public Position[] getPositions(String category)
209 throws BadPositionCategoryException {
210 throw new UnsupportedOperationException("Not implemented!");
216 * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String,
219 public boolean containsPosition(String category, int offset, int length) {
220 throw new UnsupportedOperationException("Not implemented!");
226 * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String,
229 public int computeIndexInCategory(String category, int offset)
230 throws BadLocationException, BadPositionCategoryException {
231 throw new UnsupportedOperationException("Not implemented!");
237 * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
239 // public void addPositionUpdater(IPositionUpdater updater)
241 // throw new UnsupportedOperationException("Not implemented!");
246 * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
248 public void removePositionUpdater(IPositionUpdater updater) {
249 throw new UnsupportedOperationException("Not implemented!");
255 * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater,
258 // public void insertPositionUpdater(IPositionUpdater updater, int index)
260 // throw new UnsupportedOperationException("Not implemented!");
265 * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
267 public IPositionUpdater[] getPositionUpdaters() {
268 throw new UnsupportedOperationException("Not implemented!");
274 * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
276 public String[] getLegalContentTypes() {
277 throw new UnsupportedOperationException("Not implemented!");
283 * @see org.eclipse.jface.text.IDocument#getContentType(int)
285 public String getContentType(int offset) throws BadLocationException {
286 throw new UnsupportedOperationException("Not implemented!");
292 * @see org.eclipse.jface.text.IDocument#getPartition(int)
294 public ITypedRegion getPartition(int offset) throws BadLocationException {
295 throw new UnsupportedOperationException("Not implemented!");
301 * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
303 public ITypedRegion[] computePartitioning(int offset, int length)
304 throws BadLocationException {
305 throw new UnsupportedOperationException("Not implemented!");
311 * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
313 public void addDocumentPartitioningListener(
314 IDocumentPartitioningListener listener) {
315 throw new UnsupportedOperationException("Not implemented!");
321 * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
323 public void removeDocumentPartitioningListener(
324 IDocumentPartitioningListener listener) {
325 throw new UnsupportedOperationException("Not implemented!");
331 * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
333 public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
334 throw new UnsupportedOperationException("Not implemented!");
340 * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
342 public IDocumentPartitioner getDocumentPartitioner() {
343 throw new UnsupportedOperationException("Not implemented!");
349 * @see org.eclipse.jface.text.IDocument#getLineLength(int)
351 public int getLineLength(int line) throws BadLocationException {
352 throw new UnsupportedOperationException("Not implemented!");
358 * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
360 public int getLineOfOffset(int offset) throws BadLocationException {
361 throw new UnsupportedOperationException("Not implemented!");
367 * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
369 public int getLineOffset(int line) throws BadLocationException {
370 throw new UnsupportedOperationException("Not implemented!");
376 * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
378 public IRegion getLineInformation(int line) throws BadLocationException {
379 throw new UnsupportedOperationException("Not implemented!");
385 * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
387 public IRegion getLineInformationOfOffset(int offset)
388 throws BadLocationException {
389 throw new UnsupportedOperationException("Not implemented!");
395 * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
397 public int getNumberOfLines() {
398 throw new UnsupportedOperationException("Not implemented!");
404 * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
406 public int getNumberOfLines(int offset, int length)
407 throws BadLocationException {
408 throw new UnsupportedOperationException("Not implemented!");
414 * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
416 public int computeNumberOfLines(String text) {
417 throw new UnsupportedOperationException("Not implemented!");
423 * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
425 // public String[] getLegalLineDelimiters()
427 // throw new UnsupportedOperationException("Not implemented!");
432 * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
434 // public String getLineDelimiter(int line) throws BadLocationException
436 // throw new UnsupportedOperationException("Not implemented!");
441 * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String,
442 * boolean, boolean, boolean)
444 public int search(int startOffset, String findString,
445 boolean forwardSearch, boolean caseSensitive, boolean wholeWord)
446 throws BadLocationException {
447 throw new UnsupportedOperationException("Not implemented!");