001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.text.edits;
011:
012: import org.eclipse.jface.text.BadLocationException;
013: import org.eclipse.jface.text.BadPositionCategoryException;
014: import org.eclipse.jface.text.IDocument;
015: import org.eclipse.jface.text.IDocumentListener;
016: import org.eclipse.jface.text.IDocumentPartitioner;
017: import org.eclipse.jface.text.IDocumentPartitioningListener;
018: import org.eclipse.jface.text.IPositionUpdater;
019: import org.eclipse.jface.text.IRegion;
020: import org.eclipse.jface.text.ITypedRegion;
021: import org.eclipse.jface.text.Position;
022:
023: class EditDocument implements IDocument {
024:
025: private StringBuffer fBuffer;
026:
027: public EditDocument(String content) {
028: fBuffer = new StringBuffer(content);
029: }
030:
031: public void addDocumentListener(IDocumentListener listener) {
032: throw new UnsupportedOperationException();
033: }
034:
035: public void addDocumentPartitioningListener(
036: IDocumentPartitioningListener listener) {
037: throw new UnsupportedOperationException();
038: }
039:
040: public void addPosition(Position position)
041: throws BadLocationException {
042: throw new UnsupportedOperationException();
043: }
044:
045: public void addPosition(String category, Position position)
046: throws BadLocationException, BadPositionCategoryException {
047: throw new UnsupportedOperationException();
048: }
049:
050: public void addPositionCategory(String category) {
051: throw new UnsupportedOperationException();
052: }
053:
054: public void addPositionUpdater(IPositionUpdater updater) {
055: throw new UnsupportedOperationException();
056: }
057:
058: public void addPrenotifiedDocumentListener(
059: IDocumentListener documentAdapter) {
060: throw new UnsupportedOperationException();
061: }
062:
063: public int computeIndexInCategory(String category, int offset)
064: throws BadLocationException, BadPositionCategoryException {
065: throw new UnsupportedOperationException();
066: }
067:
068: public int computeNumberOfLines(String text) {
069: throw new UnsupportedOperationException();
070: }
071:
072: public ITypedRegion[] computePartitioning(int offset, int length)
073: throws BadLocationException {
074: throw new UnsupportedOperationException();
075: }
076:
077: public boolean containsPosition(String category, int offset,
078: int length) {
079: throw new UnsupportedOperationException();
080: }
081:
082: public boolean containsPositionCategory(String category) {
083: throw new UnsupportedOperationException();
084: }
085:
086: public String get() {
087: return fBuffer.toString();
088: }
089:
090: public String get(int offset, int length)
091: throws BadLocationException {
092: return fBuffer.substring(offset, offset + length);
093: }
094:
095: public char getChar(int offset) throws BadLocationException {
096: throw new UnsupportedOperationException();
097: }
098:
099: public String getContentType(int offset)
100: throws BadLocationException {
101: throw new UnsupportedOperationException();
102: }
103:
104: public IDocumentPartitioner getDocumentPartitioner() {
105: throw new UnsupportedOperationException();
106: }
107:
108: public String[] getLegalContentTypes() {
109: throw new UnsupportedOperationException();
110: }
111:
112: public String[] getLegalLineDelimiters() {
113: throw new UnsupportedOperationException();
114: }
115:
116: public int getLength() {
117: return fBuffer.length();
118: }
119:
120: public String getLineDelimiter(int line)
121: throws BadLocationException {
122: throw new UnsupportedOperationException();
123: }
124:
125: public IRegion getLineInformation(int line)
126: throws BadLocationException {
127: throw new UnsupportedOperationException();
128: }
129:
130: public IRegion getLineInformationOfOffset(int offset)
131: throws BadLocationException {
132: throw new UnsupportedOperationException();
133: }
134:
135: public int getLineLength(int line) throws BadLocationException {
136: throw new UnsupportedOperationException();
137: }
138:
139: public int getLineOffset(int line) throws BadLocationException {
140: throw new UnsupportedOperationException();
141: }
142:
143: public int getLineOfOffset(int offset) throws BadLocationException {
144: throw new UnsupportedOperationException();
145: }
146:
147: public int getNumberOfLines() {
148: throw new UnsupportedOperationException();
149: }
150:
151: public int getNumberOfLines(int offset, int length)
152: throws BadLocationException {
153: throw new UnsupportedOperationException();
154: }
155:
156: public ITypedRegion getPartition(int offset)
157: throws BadLocationException {
158: throw new UnsupportedOperationException();
159: }
160:
161: public String[] getPositionCategories() {
162: throw new UnsupportedOperationException();
163: }
164:
165: public Position[] getPositions(String category)
166: throws BadPositionCategoryException {
167: throw new UnsupportedOperationException();
168: }
169:
170: public IPositionUpdater[] getPositionUpdaters() {
171: throw new UnsupportedOperationException();
172: }
173:
174: public void insertPositionUpdater(IPositionUpdater updater,
175: int index) {
176: throw new UnsupportedOperationException();
177: }
178:
179: public void removeDocumentListener(IDocumentListener listener) {
180: throw new UnsupportedOperationException();
181: }
182:
183: public void removeDocumentPartitioningListener(
184: IDocumentPartitioningListener listener) {
185: throw new UnsupportedOperationException();
186: }
187:
188: public void removePosition(Position position) {
189: throw new UnsupportedOperationException();
190: }
191:
192: public void removePosition(String category, Position position)
193: throws BadPositionCategoryException {
194: throw new UnsupportedOperationException();
195: }
196:
197: public void removePositionCategory(String category)
198: throws BadPositionCategoryException {
199: throw new UnsupportedOperationException();
200: }
201:
202: public void removePositionUpdater(IPositionUpdater updater) {
203: throw new UnsupportedOperationException();
204: }
205:
206: public void removePrenotifiedDocumentListener(
207: IDocumentListener documentAdapter) {
208: throw new UnsupportedOperationException();
209: }
210:
211: public void replace(int offset, int length, String text)
212: throws BadLocationException {
213: fBuffer.replace(offset, offset + length, text);
214: }
215:
216: public int search(int startOffset, String findString,
217: boolean forwardSearch, boolean caseSensitive,
218: boolean wholeWord) throws BadLocationException {
219: throw new UnsupportedOperationException();
220: }
221:
222: public void set(String text) {
223: throw new UnsupportedOperationException();
224: }
225:
226: public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
227: throw new UnsupportedOperationException();
228: }
229: }
|