2 * Created on 28.04.2003
5 package net.sourceforge.phpeclipse.phpeditor.php.test;
7 import org.eclipse.jface.text.*;
10 * Mockobject for Testing.
12 * @author Stefan Langer
13 * @version $Revision: 1.1 $
15 public class DummyDocument implements IDocument
17 private char[] fTextBuffer;
19 * @see org.eclipse.jface.text.IDocument#getChar(int)
21 public char getChar(int offset) throws BadLocationException
23 if(offset >= 0 && offset < fTextBuffer.length)
24 return fTextBuffer[offset];
26 throw new BadLocationException("Offset out of range!");
30 * @see org.eclipse.jface.text.IDocument#getLength()
32 public int getLength()
34 return fTextBuffer.length;
38 * @see org.eclipse.jface.text.IDocument#get()
42 return String.copyValueOf(fTextBuffer);
46 * @see org.eclipse.jface.text.IDocument#get(int, int)
48 public String get(int offset, int length) throws BadLocationException
50 if(offset >= 0 && (offset + length) < fTextBuffer.length)
51 return String.copyValueOf(fTextBuffer, offset, length);
53 throw new BadLocationException("Out of range!");
57 * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
59 public void set(String text)
61 fTextBuffer = text.toCharArray();
65 * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
67 public void replace(int offset, int length, String text)
68 throws BadLocationException
70 throw new UnsupportedOperationException("Not implemented!");
74 * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
76 public void addDocumentListener(IDocumentListener listener)
78 throw new UnsupportedOperationException("Not implemented!");
82 * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
84 public void removeDocumentListener(IDocumentListener listener)
86 throw new UnsupportedOperationException("Not implemented!");
90 * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
92 public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter)
94 throw new UnsupportedOperationException("Not implemented!");
98 * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
100 public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter)
102 throw new UnsupportedOperationException("Not implemented!");
106 * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
108 public void addPositionCategory(String category)
110 throw new UnsupportedOperationException("Not implemented!");
114 * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
116 public void removePositionCategory(String category)
117 throws BadPositionCategoryException
119 throw new UnsupportedOperationException("Not implemented!");
123 * @see org.eclipse.jface.text.IDocument#getPositionCategories()
125 public String[] getPositionCategories()
127 throw new UnsupportedOperationException("Not implemented!");
131 * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
133 public boolean containsPositionCategory(String category)
135 throw new UnsupportedOperationException("Not implemented!");
139 * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
141 public void addPosition(Position position) throws BadLocationException
143 throw new UnsupportedOperationException("Not implemented!");
147 * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
149 public void removePosition(Position position)
151 throw new UnsupportedOperationException("Not implemented!");
155 * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
157 public void addPosition(String category, Position position)
158 throws BadLocationException, BadPositionCategoryException
160 throw new UnsupportedOperationException("Not implemented!");
164 * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
166 public void removePosition(String category, Position position)
167 throws BadPositionCategoryException
169 throw new UnsupportedOperationException("Not implemented!");
173 * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
175 public Position[] getPositions(String category)
176 throws BadPositionCategoryException
178 throw new UnsupportedOperationException("Not implemented!");
182 * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int)
184 public boolean containsPosition(String category, int offset, int length)
186 throw new UnsupportedOperationException("Not implemented!");
190 * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int)
192 public int computeIndexInCategory(String category, int offset)
193 throws BadLocationException, BadPositionCategoryException
195 throw new UnsupportedOperationException("Not implemented!");
199 * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
201 public void addPositionUpdater(IPositionUpdater updater)
203 throw new UnsupportedOperationException("Not implemented!");
207 * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
209 public void removePositionUpdater(IPositionUpdater updater)
211 throw new UnsupportedOperationException("Not implemented!");
215 * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int)
217 public void insertPositionUpdater(IPositionUpdater updater, int index)
219 throw new UnsupportedOperationException("Not implemented!");
223 * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
225 public IPositionUpdater[] getPositionUpdaters()
227 throw new UnsupportedOperationException("Not implemented!");
231 * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
233 public String[] getLegalContentTypes()
235 throw new UnsupportedOperationException("Not implemented!");
239 * @see org.eclipse.jface.text.IDocument#getContentType(int)
241 public String getContentType(int offset) throws BadLocationException
243 throw new UnsupportedOperationException("Not implemented!");
247 * @see org.eclipse.jface.text.IDocument#getPartition(int)
249 public ITypedRegion getPartition(int offset) throws BadLocationException
251 throw new UnsupportedOperationException("Not implemented!");
255 * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
257 public ITypedRegion[] computePartitioning(int offset, int length)
258 throws BadLocationException
260 throw new UnsupportedOperationException("Not implemented!");
264 * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
266 public void addDocumentPartitioningListener(IDocumentPartitioningListener listener)
268 throw new UnsupportedOperationException("Not implemented!");
272 * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
274 public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener)
276 throw new UnsupportedOperationException("Not implemented!");
280 * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
282 public void setDocumentPartitioner(IDocumentPartitioner partitioner)
284 throw new UnsupportedOperationException("Not implemented!");
288 * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
290 public IDocumentPartitioner getDocumentPartitioner()
292 throw new UnsupportedOperationException("Not implemented!");
296 * @see org.eclipse.jface.text.IDocument#getLineLength(int)
298 public int getLineLength(int line) throws BadLocationException
300 throw new UnsupportedOperationException("Not implemented!");
304 * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
306 public int getLineOfOffset(int offset) throws BadLocationException
308 throw new UnsupportedOperationException("Not implemented!");
312 * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
314 public int getLineOffset(int line) throws BadLocationException
316 throw new UnsupportedOperationException("Not implemented!");
320 * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
322 public IRegion getLineInformation(int line) throws BadLocationException
324 throw new UnsupportedOperationException("Not implemented!");
328 * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
330 public IRegion getLineInformationOfOffset(int offset)
331 throws BadLocationException
333 throw new UnsupportedOperationException("Not implemented!");
337 * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
339 public int getNumberOfLines()
341 throw new UnsupportedOperationException("Not implemented!");
345 * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
347 public int getNumberOfLines(int offset, int length)
348 throws BadLocationException
350 throw new UnsupportedOperationException("Not implemented!");
354 * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
356 public int computeNumberOfLines(String text)
358 throw new UnsupportedOperationException("Not implemented!");
362 * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
364 public String[] getLegalLineDelimiters()
366 throw new UnsupportedOperationException("Not implemented!");
370 * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
372 public String getLineDelimiter(int line) throws BadLocationException
374 throw new UnsupportedOperationException("Not implemented!");
378 * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String, boolean, boolean, boolean)
383 boolean forwardSearch,
384 boolean caseSensitive,
386 throws BadLocationException
388 throw new UnsupportedOperationException("Not implemented!");