KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > text > edits > EditDocument


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.text.edits;
12
13 import org.eclipse.jface.text.BadLocationException;
14 import org.eclipse.jface.text.BadPositionCategoryException;
15 import org.eclipse.jface.text.IDocument;
16 import org.eclipse.jface.text.IDocumentListener;
17 import org.eclipse.jface.text.IDocumentPartitioner;
18 import org.eclipse.jface.text.IDocumentPartitioningListener;
19 import org.eclipse.jface.text.IPositionUpdater;
20 import org.eclipse.jface.text.IRegion;
21 import org.eclipse.jface.text.ITypedRegion;
22 import org.eclipse.jface.text.Position;
23
24 class EditDocument implements IDocument {
25
26     private StringBuffer JavaDoc fBuffer;
27
28     public EditDocument(String JavaDoc content) {
29         fBuffer= new StringBuffer JavaDoc(content);
30     }
31
32     public void addDocumentListener(IDocumentListener listener) {
33         throw new UnsupportedOperationException JavaDoc();
34     }
35
36     public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
37         throw new UnsupportedOperationException JavaDoc();
38     }
39
40     public void addPosition(Position position) throws BadLocationException {
41         throw new UnsupportedOperationException JavaDoc();
42     }
43
44     public void addPosition(String JavaDoc category, Position position) throws BadLocationException, BadPositionCategoryException {
45         throw new UnsupportedOperationException JavaDoc();
46     }
47
48     public void addPositionCategory(String JavaDoc category) {
49         throw new UnsupportedOperationException JavaDoc();
50     }
51
52     public void addPositionUpdater(IPositionUpdater updater) {
53         throw new UnsupportedOperationException JavaDoc();
54     }
55
56     public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
57         throw new UnsupportedOperationException JavaDoc();
58     }
59
60     public int computeIndexInCategory(String JavaDoc category, int offset) throws BadLocationException, BadPositionCategoryException {
61         throw new UnsupportedOperationException JavaDoc();
62     }
63
64     public int computeNumberOfLines(String JavaDoc text) {
65         throw new UnsupportedOperationException JavaDoc();
66     }
67
68     public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
69         throw new UnsupportedOperationException JavaDoc();
70     }
71
72     public boolean containsPosition(String JavaDoc category, int offset, int length) {
73         throw new UnsupportedOperationException JavaDoc();
74     }
75
76     public boolean containsPositionCategory(String JavaDoc category) {
77         throw new UnsupportedOperationException JavaDoc();
78     }
79
80     public String JavaDoc get() {
81         return fBuffer.toString();
82     }
83
84     public String JavaDoc get(int offset, int length) throws BadLocationException {
85         return fBuffer.substring(offset, offset + length);
86     }
87
88     public char getChar(int offset) throws BadLocationException {
89         throw new UnsupportedOperationException JavaDoc();
90     }
91
92     public String JavaDoc getContentType(int offset) throws BadLocationException {
93         throw new UnsupportedOperationException JavaDoc();
94     }
95
96     public IDocumentPartitioner getDocumentPartitioner() {
97         throw new UnsupportedOperationException JavaDoc();
98     }
99
100     public String JavaDoc[] getLegalContentTypes() {
101         throw new UnsupportedOperationException JavaDoc();
102     }
103
104     public String JavaDoc[] getLegalLineDelimiters() {
105         throw new UnsupportedOperationException JavaDoc();
106     }
107
108     public int getLength() {
109         return fBuffer.length();
110     }
111
112     public String JavaDoc getLineDelimiter(int line) throws BadLocationException {
113         throw new UnsupportedOperationException JavaDoc();
114     }
115
116     public IRegion getLineInformation(int line) throws BadLocationException {
117         throw new UnsupportedOperationException JavaDoc();
118     }
119
120     public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
121         throw new UnsupportedOperationException JavaDoc();
122     }
123
124     public int getLineLength(int line) throws BadLocationException {
125         throw new UnsupportedOperationException JavaDoc();
126     }
127
128     public int getLineOffset(int line) throws BadLocationException {
129         throw new UnsupportedOperationException JavaDoc();
130     }
131
132     public int getLineOfOffset(int offset) throws BadLocationException {
133         throw new UnsupportedOperationException JavaDoc();
134     }
135
136     public int getNumberOfLines() {
137         throw new UnsupportedOperationException JavaDoc();
138     }
139
140     public int getNumberOfLines(int offset, int length) throws BadLocationException {
141         throw new UnsupportedOperationException JavaDoc();
142     }
143
144     public ITypedRegion getPartition(int offset) throws BadLocationException {
145         throw new UnsupportedOperationException JavaDoc();
146     }
147
148     public String JavaDoc[] getPositionCategories() {
149         throw new UnsupportedOperationException JavaDoc();
150     }
151
152     public Position[] getPositions(String JavaDoc category) throws BadPositionCategoryException {
153         throw new UnsupportedOperationException JavaDoc();
154     }
155
156     public IPositionUpdater[] getPositionUpdaters() {
157         throw new UnsupportedOperationException JavaDoc();
158     }
159
160     public void insertPositionUpdater(IPositionUpdater updater, int index) {
161         throw new UnsupportedOperationException JavaDoc();
162     }
163
164     public void removeDocumentListener(IDocumentListener listener) {
165         throw new UnsupportedOperationException JavaDoc();
166     }
167
168     public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
169         throw new UnsupportedOperationException JavaDoc();
170     }
171
172     public void removePosition(Position position) {
173         throw new UnsupportedOperationException JavaDoc();
174     }
175
176     public void removePosition(String JavaDoc category, Position position) throws BadPositionCategoryException {
177         throw new UnsupportedOperationException JavaDoc();
178     }
179
180     public void removePositionCategory(String JavaDoc category) throws BadPositionCategoryException {
181         throw new UnsupportedOperationException JavaDoc();
182     }
183
184     public void removePositionUpdater(IPositionUpdater updater) {
185         throw new UnsupportedOperationException JavaDoc();
186     }
187
188     public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
189         throw new UnsupportedOperationException JavaDoc();
190     }
191
192     public void replace(int offset, int length, String JavaDoc text) throws BadLocationException {
193         fBuffer.replace(offset, offset + length, text);
194     }
195
196     public int search(int startOffset, String JavaDoc findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException {
197         throw new UnsupportedOperationException JavaDoc();
198     }
199
200     public void set(String JavaDoc text) {
201         throw new UnsupportedOperationException JavaDoc();
202     }
203
204     public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
205         throw new UnsupportedOperationException JavaDoc();
206     }
207 }
208
Popular Tags