1 11 12 package org.eclipse.jface.text; 13 14 15 107 public interface IDocument { 108 109 110 113 final static String DEFAULT_CATEGORY= "__dflt_position_category"; 115 118 final static String DEFAULT_CONTENT_TYPE= "__dftl_partition_content_type"; 120 121 122 123 124 125 132 char getChar(int offset) throws BadLocationException; 133 134 139 int getLength(); 140 141 146 String get(); 147 148 156 String get(int offset, int length) throws BadLocationException; 157 158 168 void set(String text); 169 170 182 void replace(int offset, int length, String text) throws BadLocationException; 183 184 193 void addDocumentListener(IDocumentListener listener); 194 195 203 void removeDocumentListener(IDocumentListener listener); 204 205 218 void addPrenotifiedDocumentListener(IDocumentListener documentAdapter); 219 220 231 void removePrenotifiedDocumentListener(IDocumentListener documentAdapter); 232 233 234 235 236 237 243 void addPositionCategory(String category); 244 245 252 void removePositionCategory(String category) throws BadPositionCategoryException; 253 254 260 String [] getPositionCategories(); 261 262 268 boolean containsPositionCategory(String category); 269 270 277 void addPosition(Position position) throws BadLocationException; 278 279 285 void removePosition(Position position); 286 287 298 void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException; 299 300 309 void removePosition(String category, Position position) throws BadPositionCategoryException; 310 311 321 Position[] getPositions(String category) throws BadPositionCategoryException; 322 323 331 boolean containsPosition(String category, int offset, int length); 332 333 345 int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException; 346 347 355 void addPositionUpdater(IPositionUpdater updater); 356 357 367 void removePositionUpdater(IPositionUpdater updater); 368 369 378 void insertPositionUpdater(IPositionUpdater updater, int index); 379 380 385 IPositionUpdater[] getPositionUpdaters(); 386 387 388 389 390 391 392 406 String [] getLegalContentTypes(); 407 408 424 String getContentType(int offset) throws BadLocationException; 425 426 441 ITypedRegion getPartition(int offset) throws BadLocationException; 442 443 460 ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException; 461 462 480 void addDocumentPartitioningListener(IDocumentPartitioningListener listener); 481 482 491 void removeDocumentPartitioningListener(IDocumentPartitioningListener listener); 492 493 510 void setDocumentPartitioner(IDocumentPartitioner partitioner); 511 512 525 IDocumentPartitioner getDocumentPartitioner(); 526 527 528 529 530 531 538 int getLineLength(int line) throws BadLocationException; 539 540 550 int getLineOfOffset(int offset) throws BadLocationException; 551 552 559 int getLineOffset(int line) throws BadLocationException; 560 561 569 IRegion getLineInformation(int line) throws BadLocationException; 570 571 580 IRegion getLineInformationOfOffset(int offset) throws BadLocationException; 581 582 587 int getNumberOfLines(); 588 589 597 int getNumberOfLines(int offset, int length) throws BadLocationException; 598 599 607 int computeNumberOfLines(String text); 608 609 610 611 612 617 String [] getLegalLineDelimiters(); 618 619 627 String getLineDelimiter(int line) throws BadLocationException; 628 629 630 631 632 645 int search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException; 646 } 647 | Popular Tags |