comparison dwtx/text/edits/EditDocument.d @ 129:eb30df5ca28b

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