comparison dwtx/jface/text/projection/ProjectionDocument.d @ 140:26688fec6d23

Following dsss compile errors
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 03:23:46 +0200
parents b6bad70d540a
children 75302ef3f92f
comparison
equal deleted inserted replaced
139:93a6ec48fd28 140:26688fec6d23
197 return null; 197 return null;
198 } 198 }
199 199
200 /** 200 /**
201 * Returns the projection mapping used by this document. 201 * Returns the projection mapping used by this document.
202 * 202 *
203 * @return the projection mapping used by this document 203 * @return the projection mapping used by this document
204 * @deprecated As of 3.4, replaced by {@link #getDocumentInformationMapping()} 204 * @deprecated As of 3.4, replaced by {@link #getDocumentInformationMapping()}
205 */ 205 */
206 public ProjectionMapping getProjectionMapping(){ 206 public ProjectionMapping getProjectionMapping(){
207 return fMapping; 207 return fMapping;
208 } 208 }
209 209
210 /** 210 /**
211 * Returns the projection mapping used by this document. 211 * Returns the projection mapping used by this document.
212 * 212 *
213 * @return the projection mapping used by this document 213 * @return the projection mapping used by this document
214 * @since 3.4 214 * @since 3.4
215 */ 215 */
216 public IDocumentInformationMapping getDocumentInformationMapping() { 216 public IDocumentInformationMapping getDocumentInformationMapping() {
217 return fMapping; 217 return fMapping;
223 * @return the master document of this projection document 223 * @return the master document of this projection document
224 */ 224 */
225 public IDocument getMasterDocument() { 225 public IDocument getMasterDocument() {
226 return fMasterDocument; 226 return fMasterDocument;
227 } 227 }
228 228
229 /* 229 /*
230 * @see dwtx.jface.text.IDocumentExtension4#getDefaultLineDelimiter() 230 * @see dwtx.jface.text.IDocumentExtension4#getDefaultLineDelimiter()
231 * @since 3.1 231 * @since 3.1
232 */ 232 */
233 public String getDefaultLineDelimiter() { 233 public String getDefaultLineDelimiter() {
234 return TextUtilities.getDefaultLineDelimiter(fMasterDocument); 234 return TextUtilities.getDefaultLineDelimiter(fMasterDocument);
235 } 235 }
236 236
237 /** 237 /**
238 * Initializes the projection document from the master document based on 238 * Initializes the projection document from the master document based on
239 * the master's fragments. 239 * the master's fragments.
240 */ 240 */
241 private void initializeProjection() { 241 private void initializeProjection() {
270 * @param index the index in the list of segments 270 * @param index the index in the list of segments
271 * @return the created segment 271 * @return the created segment
272 * @throws BadLocationException in case the fragment is invalid 272 * @throws BadLocationException in case the fragment is invalid
273 * @throws BadPositionCategoryException in case the segment category is invalid 273 * @throws BadPositionCategoryException in case the segment category is invalid
274 */ 274 */
275 private Segment createSegmentFor(Fragment fragment, int index) throws BadLocationException, BadPositionCategoryException { 275 private Segment createSegmentFor(Fragment fragment, int index) {
276 276
277 int offset= 0; 277 int offset= 0;
278 if (index > 0) { 278 if (index > 0) {
279 Position[] segments= getSegments(); 279 Position[] segments= getSegments();
280 Segment segment= cast(Segment) segments[index - 1]; 280 Segment segment= cast(Segment) segments[index - 1];
476 IRegion imageRegion= fMapping.toImageRegion(new Region(offsetInMaster, lengthInMaster)); 476 IRegion imageRegion= fMapping.toImageRegion(new Region(offsetInMaster, lengthInMaster));
477 if (imageRegion !is null) 477 if (imageRegion !is null)
478 fragments= fMapping.toExactOriginRegions(imageRegion); 478 fragments= fMapping.toExactOriginRegions(imageRegion);
479 479
480 if (fragments is null || fragments.length is 0) 480 if (fragments is null || fragments.length is 0)
481 return new IRegion[] { new Region(offsetInMaster, lengthInMaster) }; 481 return [ new Region(offsetInMaster, lengthInMaster) ];
482 482
483 List gaps= new ArrayList(); 483 List gaps= new ArrayList();
484 484
485 IRegion region= fragments[0]; 485 IRegion region= fragments[0];
486 if (offsetInMaster < region.getOffset()) 486 if (offsetInMaster < region.getOffset())
841 Fragment fragment= segment.fragment; 841 Fragment fragment= segment.fragment;
842 if (fragment.getOffset() + fragment.getLength() is next.fragment.getOffset()) { 842 if (fragment.getOffset() + fragment.getLength() is next.fragment.getOffset()) {
843 // join fragments and their corresponding segments 843 // join fragments and their corresponding segments
844 segment.setLength(segment.getLength() + next.getLength()); 844 segment.setLength(segment.getLength() + next.getLength());
845 fragment.setLength(fragment.getLength() + next.fragment.getLength()); 845 fragment.setLength(fragment.getLength() + next.fragment.getLength());
846 next.delete(); 846 next.delete_();
847 } 847 }
848 } 848 }
849 } 849 }
850 850
851 if (changed && anchorOffset !is -1) { 851 if (changed && anchorOffset !is -1) {