Moved testcase for partitionscanner from phpeclipse.php to phpeclipse.tests to elimin...
[phpeclipse.git] / net.sourceforge.phpeclipse.tests / src / net / sourceforge / phpeclipse / phpeditor / php / test / DummyDocument.java
1 /*
2  * Created on 28.04.2003
3  *
4  */
5 package net.sourceforge.phpeclipse.phpeditor.php.test;
6
7 import org.eclipse.jface.text.*;
8
9 /** 
10  * Mockobject for Testing.
11  * 
12  * @author Stefan Langer
13  * @version $Revision: 1.1 $
14  */
15 public class DummyDocument implements IDocument
16 {
17         private char[] fTextBuffer;
18     /* (non-Javadoc)
19      * @see org.eclipse.jface.text.IDocument#getChar(int)
20      */
21     public char getChar(int offset) throws BadLocationException
22     {
23         if(offset >= 0 && offset < fTextBuffer.length)
24                 return fTextBuffer[offset];
25         else
26                 throw new BadLocationException("Offset out of range!");
27     }
28
29     /* (non-Javadoc)
30      * @see org.eclipse.jface.text.IDocument#getLength()
31      */
32     public int getLength()
33     {
34         return fTextBuffer.length;
35     }
36
37     /* (non-Javadoc)
38      * @see org.eclipse.jface.text.IDocument#get()
39      */
40     public String get()
41     {
42         return String.copyValueOf(fTextBuffer);
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.jface.text.IDocument#get(int, int)
47      */
48     public String get(int offset, int length) throws BadLocationException
49     {
50         if(offset >= 0 && (offset + length) < fTextBuffer.length)
51                 return String.copyValueOf(fTextBuffer, offset, length);
52         else
53                 throw new BadLocationException("Out of range!");
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
58      */
59     public void set(String text)
60     {
61        fTextBuffer = text.toCharArray();
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
66      */
67     public void replace(int offset, int length, String text)
68         throws BadLocationException
69     {
70         throw new UnsupportedOperationException("Not implemented!");
71     }
72
73     /* (non-Javadoc)
74      * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
75      */
76     public void addDocumentListener(IDocumentListener listener)
77     {
78                 throw new UnsupportedOperationException("Not implemented!");
79     }
80
81     /* (non-Javadoc)
82      * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
83      */
84     public void removeDocumentListener(IDocumentListener listener)
85     {
86                 throw new UnsupportedOperationException("Not implemented!");
87     }
88
89     /* (non-Javadoc)
90      * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
91      */
92     public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter)
93     {
94                 throw new UnsupportedOperationException("Not implemented!");
95     }
96
97     /* (non-Javadoc)
98      * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
99      */
100     public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter)
101     {
102                 throw new UnsupportedOperationException("Not implemented!");
103     }
104
105     /* (non-Javadoc)
106      * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
107      */
108     public void addPositionCategory(String category)
109     {
110                 throw new UnsupportedOperationException("Not implemented!");
111     }
112
113     /* (non-Javadoc)
114      * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
115      */
116     public void removePositionCategory(String category)
117         throws BadPositionCategoryException
118     {
119                 throw new UnsupportedOperationException("Not implemented!");
120     }
121
122     /* (non-Javadoc)
123      * @see org.eclipse.jface.text.IDocument#getPositionCategories()
124      */
125     public String[] getPositionCategories()
126     {
127                 throw new UnsupportedOperationException("Not implemented!");
128     }
129
130     /* (non-Javadoc)
131      * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
132      */
133     public boolean containsPositionCategory(String category)
134     {
135                 throw new UnsupportedOperationException("Not implemented!");
136     }
137
138     /* (non-Javadoc)
139      * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
140      */
141     public void addPosition(Position position) throws BadLocationException
142     {
143                 throw new UnsupportedOperationException("Not implemented!");
144     }
145
146     /* (non-Javadoc)
147      * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
148      */
149     public void removePosition(Position position)
150     {
151                 throw new UnsupportedOperationException("Not implemented!");
152      }
153
154     /* (non-Javadoc)
155      * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
156      */
157     public void addPosition(String category, Position position)
158         throws BadLocationException, BadPositionCategoryException
159     {
160                 throw new UnsupportedOperationException("Not implemented!");
161      }
162
163     /* (non-Javadoc)
164      * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
165      */
166     public void removePosition(String category, Position position)
167         throws BadPositionCategoryException
168     {
169                 throw new UnsupportedOperationException("Not implemented!");
170     }
171
172     /* (non-Javadoc)
173      * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
174      */
175     public Position[] getPositions(String category)
176         throws BadPositionCategoryException
177     {
178                 throw new UnsupportedOperationException("Not implemented!");
179     }
180
181     /* (non-Javadoc)
182      * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int)
183      */
184     public boolean containsPosition(String category, int offset, int length)
185     {
186                 throw new UnsupportedOperationException("Not implemented!");
187     }
188
189     /* (non-Javadoc)
190      * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int)
191      */
192     public int computeIndexInCategory(String category, int offset)
193         throws BadLocationException, BadPositionCategoryException
194     {
195                 throw new UnsupportedOperationException("Not implemented!");
196     }
197
198     /* (non-Javadoc)
199      * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
200      */
201     public void addPositionUpdater(IPositionUpdater updater)
202     {
203                 throw new UnsupportedOperationException("Not implemented!");
204     }
205
206     /* (non-Javadoc)
207      * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
208      */
209     public void removePositionUpdater(IPositionUpdater updater)
210     {
211                 throw new UnsupportedOperationException("Not implemented!");
212     }
213
214     /* (non-Javadoc)
215      * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int)
216      */
217     public void insertPositionUpdater(IPositionUpdater updater, int index)
218     {
219                 throw new UnsupportedOperationException("Not implemented!");
220     }
221
222     /* (non-Javadoc)
223      * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
224      */
225     public IPositionUpdater[] getPositionUpdaters()
226     {
227                 throw new UnsupportedOperationException("Not implemented!");
228     }
229
230     /* (non-Javadoc)
231      * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
232      */
233     public String[] getLegalContentTypes()
234     {
235                 throw new UnsupportedOperationException("Not implemented!");
236     }
237
238     /* (non-Javadoc)
239      * @see org.eclipse.jface.text.IDocument#getContentType(int)
240      */
241     public String getContentType(int offset) throws BadLocationException
242     {
243                 throw new UnsupportedOperationException("Not implemented!");
244     }
245
246     /* (non-Javadoc)
247      * @see org.eclipse.jface.text.IDocument#getPartition(int)
248      */
249     public ITypedRegion getPartition(int offset) throws BadLocationException
250     {
251                 throw new UnsupportedOperationException("Not implemented!");
252     }
253
254     /* (non-Javadoc)
255      * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
256      */
257     public ITypedRegion[] computePartitioning(int offset, int length)
258         throws BadLocationException
259     {
260                 throw new UnsupportedOperationException("Not implemented!");
261     }
262
263     /* (non-Javadoc)
264      * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
265      */
266     public void addDocumentPartitioningListener(IDocumentPartitioningListener listener)
267     {
268                 throw new UnsupportedOperationException("Not implemented!");
269     }
270
271     /* (non-Javadoc)
272      * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
273      */
274     public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener)
275     {
276                 throw new UnsupportedOperationException("Not implemented!");
277     }
278
279     /* (non-Javadoc)
280      * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
281      */
282     public void setDocumentPartitioner(IDocumentPartitioner partitioner)
283     {
284                 throw new UnsupportedOperationException("Not implemented!");
285     }
286
287     /* (non-Javadoc)
288      * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
289      */
290     public IDocumentPartitioner getDocumentPartitioner()
291     {
292                 throw new UnsupportedOperationException("Not implemented!");
293     }
294
295     /* (non-Javadoc)
296      * @see org.eclipse.jface.text.IDocument#getLineLength(int)
297      */
298     public int getLineLength(int line) throws BadLocationException
299     {
300                 throw new UnsupportedOperationException("Not implemented!");
301     }
302
303     /* (non-Javadoc)
304      * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
305      */
306     public int getLineOfOffset(int offset) throws BadLocationException
307     {
308                 throw new UnsupportedOperationException("Not implemented!");
309     }
310
311     /* (non-Javadoc)
312      * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
313      */
314     public int getLineOffset(int line) throws BadLocationException
315     {
316                 throw new UnsupportedOperationException("Not implemented!");
317     }
318
319     /* (non-Javadoc)
320      * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
321      */
322     public IRegion getLineInformation(int line) throws BadLocationException
323     {
324                 throw new UnsupportedOperationException("Not implemented!");
325     }
326
327     /* (non-Javadoc)
328      * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
329      */
330     public IRegion getLineInformationOfOffset(int offset)
331         throws BadLocationException
332     {
333                 throw new UnsupportedOperationException("Not implemented!");
334     }
335
336     /* (non-Javadoc)
337      * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
338      */
339     public int getNumberOfLines()
340     {
341                 throw new UnsupportedOperationException("Not implemented!");
342     }
343
344     /* (non-Javadoc)
345      * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
346      */
347     public int getNumberOfLines(int offset, int length)
348         throws BadLocationException
349     {
350                 throw new UnsupportedOperationException("Not implemented!");
351     }
352
353     /* (non-Javadoc)
354      * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
355      */
356     public int computeNumberOfLines(String text)
357     {
358                 throw new UnsupportedOperationException("Not implemented!");
359     }
360
361     /* (non-Javadoc)
362      * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
363      */
364     public String[] getLegalLineDelimiters()
365     {
366                 throw new UnsupportedOperationException("Not implemented!");
367     }
368
369     /* (non-Javadoc)
370      * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
371      */
372     public String getLineDelimiter(int line) throws BadLocationException
373     {
374                 throw new UnsupportedOperationException("Not implemented!");
375     }
376
377     /* (non-Javadoc)
378      * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String, boolean, boolean, boolean)
379      */
380     public int search(
381         int startOffset,
382         String findString,
383         boolean forwardSearch,
384         boolean caseSensitive,
385         boolean wholeWord)
386         throws BadLocationException
387     {
388                 throw new UnsupportedOperationException("Not implemented!");
389     }
390
391 }