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