comparison dwtx/jface/text/IDocument.d @ 139:93a6ec48fd28

Regexp throws removal in interfaces
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 02:31:41 +0200
parents 51e6e63f930e
children ea8dd2e11034
comparison
equal deleted inserted replaced
138:b6bad70d540a 139:93a6ec48fd28
273 * 273 *
274 * @param offset a document offset 274 * @param offset a document offset
275 * @return the character at the offset 275 * @return the character at the offset
276 * @exception BadLocationException if the offset is invalid in this document 276 * @exception BadLocationException if the offset is invalid in this document
277 */ 277 */
278 char getChar(int offset) throws BadLocationException; 278 char getChar(int offset) ;
279 279
280 /** 280 /**
281 * Returns the number of characters in this document. 281 * Returns the number of characters in this document.
282 * 282 *
283 * @return the number of characters in this document 283 * @return the number of characters in this document
297 * @param offset the document offset 297 * @param offset the document offset
298 * @param length the length of the specified range 298 * @param length the length of the specified range
299 * @return the document's text for the specified range 299 * @return the document's text for the specified range
300 * @exception BadLocationException if the range is invalid in this document 300 * @exception BadLocationException if the range is invalid in this document
301 */ 301 */
302 String get(int offset, int length) throws BadLocationException; 302 String get(int offset, int length) ;
303 303
304 /** 304 /**
305 * Replaces the content of the document with the given text. 305 * Replaces the content of the document with the given text.
306 * Sends a <code>DocumentEvent</code> to all registered <code>IDocumentListener</code>. 306 * Sends a <code>DocumentEvent</code> to all registered <code>IDocumentListener</code>.
307 * This method is a convenience method for <code>replace(0, getLength(), text)</code>. 307 * This method is a convenience method for <code>replace(0, getLength(), text)</code>.
323 * @exception BadLocationException if the offset is invalid in this document 323 * @exception BadLocationException if the offset is invalid in this document
324 * 324 *
325 * @see DocumentEvent 325 * @see DocumentEvent
326 * @see IDocumentListener 326 * @see IDocumentListener
327 */ 327 */
328 void replace(int offset, int length, String text) throws BadLocationException; 328 void replace(int offset, int length, String text) ;
329 329
330 /** 330 /**
331 * Registers the document listener with the document. After registration 331 * Registers the document listener with the document. After registration
332 * the IDocumentListener is informed about each change of this document. 332 * the IDocumentListener is informed about each change of this document.
333 * If the listener is already registered nothing happens.<p> 333 * If the listener is already registered nothing happens.<p>
393 * in this category are thus deleted as well. 393 * in this category are thus deleted as well.
394 * 394 *
395 * @param category the category to be removed 395 * @param category the category to be removed
396 * @exception BadPositionCategoryException if category is undefined in this document 396 * @exception BadPositionCategoryException if category is undefined in this document
397 */ 397 */
398 void removePositionCategory(String category) throws BadPositionCategoryException; 398 void removePositionCategory(String category) ;
399 399
400 /** 400 /**
401 * Returns all position categories of this document. This 401 * Returns all position categories of this document. This
402 * includes the default position category. 402 * includes the default position category.
403 * 403 *
418 * This is a convenience method for <code>addPosition(DEFAULT_CATEGORY, position)</code>. 418 * This is a convenience method for <code>addPosition(DEFAULT_CATEGORY, position)</code>.
419 * 419 *
420 * @param position the position to be added 420 * @param position the position to be added
421 * @exception BadLocationException if position describes an invalid range in this document 421 * @exception BadLocationException if position describes an invalid range in this document
422 */ 422 */
423 void addPosition(Position position) throws BadLocationException; 423 void addPosition(Position position) ;
424 424
425 /** 425 /**
426 * Removes the given position from the document's default position category. 426 * Removes the given position from the document's default position category.
427 * This is a convenience method for <code>removePosition(DEFAULT_CATEGORY, position)</code>. 427 * This is a convenience method for <code>removePosition(DEFAULT_CATEGORY, position)</code>.
428 * 428 *
454 * 454 *
455 * @param category the category from which to delete 455 * @param category the category from which to delete
456 * @param position the position to be deleted 456 * @param position the position to be deleted
457 * @exception BadPositionCategoryException if category is undefined in this document 457 * @exception BadPositionCategoryException if category is undefined in this document
458 */ 458 */
459 void removePosition(String category, Position position) throws BadPositionCategoryException; 459 void removePosition(String category, Position position) ;
460 460
461 /** 461 /**
462 * Returns all positions of the given position category. 462 * Returns all positions of the given position category.
463 * The positions are ordered according to the category's order. 463 * The positions are ordered according to the category's order.
464 * Manipulating this list does not affect the document, but manipulating the 464 * Manipulating this list does not affect the document, but manipulating the
466 * 466 *
467 * @param category the category 467 * @param category the category
468 * @return the list of all positions 468 * @return the list of all positions
469 * @exception BadPositionCategoryException if category is undefined in this document 469 * @exception BadPositionCategoryException if category is undefined in this document
470 */ 470 */
471 Position[] getPositions(String category) throws BadPositionCategoryException; 471 Position[] getPositions(String category) ;
472 472
473 /** 473 /**
474 * Determines whether a position described by the parameters is managed by this document. 474 * Determines whether a position described by the parameters is managed by this document.
475 * 475 *
476 * @param category the category to check 476 * @param category the category to check
569 * 569 *
570 * @param offset the document offset 570 * @param offset the document offset
571 * @return the partition type 571 * @return the partition type
572 * @exception BadLocationException if offset is invalid in this document 572 * @exception BadLocationException if offset is invalid in this document
573 */ 573 */
574 String getContentType(int offset) throws BadLocationException; 574 String getContentType(int offset) ;
575 575
576 /** 576 /**
577 * Returns the document partition in which the position is located. 577 * Returns the document partition in which the position is located.
578 * <p> 578 * <p>
579 * Use {@link IDocumentExtension3#getPartition(String, int, bool)} when 579 * Use {@link IDocumentExtension3#getPartition(String, int, bool)} when
586 * 586 *
587 * @param offset the document offset 587 * @param offset the document offset
588 * @return a specification of the partition 588 * @return a specification of the partition
589 * @exception BadLocationException if offset is invalid in this document 589 * @exception BadLocationException if offset is invalid in this document
590 */ 590 */
591 ITypedRegion getPartition(int offset) throws BadLocationException; 591 ITypedRegion getPartition(int offset) ;
592 592
593 /** 593 /**
594 * Computes the partitioning of the given document range using the 594 * Computes the partitioning of the given document range using the
595 * document's partitioner. 595 * document's partitioner.
596 * <p> 596 * <p>
605 * @param offset the document offset at which the range starts 605 * @param offset the document offset at which the range starts
606 * @param length the length of the document range 606 * @param length the length of the document range
607 * @return a specification of the range's partitioning 607 * @return a specification of the range's partitioning
608 * @exception BadLocationException if the range is invalid in this document 608 * @exception BadLocationException if the range is invalid in this document
609 */ 609 */
610 ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException; 610 ITypedRegion[] computePartitioning(int offset, int length) ;
611 611
612 /** 612 /**
613 * Registers the document partitioning listener with the document. After registration 613 * Registers the document partitioning listener with the document. After registration
614 * the document partitioning listener is informed about each partition change 614 * the document partitioning listener is informed about each partition change
615 * cause by a document manipulation or by changing the document's partitioner. 615 * cause by a document manipulation or by changing the document's partitioner.
683 * 683 *
684 * @param line the line of interest 684 * @param line the line of interest
685 * @return the length of the line 685 * @return the length of the line
686 * @exception BadLocationException if the line number is invalid in this document 686 * @exception BadLocationException if the line number is invalid in this document
687 */ 687 */
688 int getLineLength(int line) throws BadLocationException; 688 int getLineLength(int line) ;
689 689
690 /** 690 /**
691 * Returns the number of the line at which the character of the specified position is located. 691 * Returns the number of the line at which the character of the specified position is located.
692 * The first line has the line number 0. A new line starts directly after a line 692 * The first line has the line number 0. A new line starts directly after a line
693 * delimiter. <code>(offset is document length)</code> is a valid argument although there is no 693 * delimiter. <code>(offset is document length)</code> is a valid argument although there is no
695 * 695 *
696 * @param offset the document offset 696 * @param offset the document offset
697 * @return the number of the line 697 * @return the number of the line
698 * @exception BadLocationException if the offset is invalid in this document 698 * @exception BadLocationException if the offset is invalid in this document
699 */ 699 */
700 int getLineOfOffset(int offset) throws BadLocationException; 700 int getLineOfOffset(int offset) ;
701 701
702 /** 702 /**
703 * Determines the offset of the first character of the given line. 703 * Determines the offset of the first character of the given line.
704 * 704 *
705 * @param line the line of interest 705 * @param line the line of interest
706 * @return the document offset 706 * @return the document offset
707 * @exception BadLocationException if the line number is invalid in this document 707 * @exception BadLocationException if the line number is invalid in this document
708 */ 708 */
709 int getLineOffset(int line) throws BadLocationException; 709 int getLineOffset(int line) ;
710 710
711 /** 711 /**
712 * Returns a description of the specified line. The line is described by its 712 * Returns a description of the specified line. The line is described by its
713 * offset and its length excluding the line's delimiter. 713 * offset and its length excluding the line's delimiter.
714 * 714 *
715 * @param line the line of interest 715 * @param line the line of interest
716 * @return a line description 716 * @return a line description
717 * @exception BadLocationException if the line number is invalid in this document 717 * @exception BadLocationException if the line number is invalid in this document
718 */ 718 */
719 IRegion getLineInformation(int line) throws BadLocationException; 719 IRegion getLineInformation(int line) ;
720 720
721 /** 721 /**
722 * Returns a description of the line at the given offset. 722 * Returns a description of the line at the given offset.
723 * The description contains the offset and the length of the line 723 * The description contains the offset and the length of the line
724 * excluding the line's delimiter. 724 * excluding the line's delimiter.
725 * 725 *
726 * @param offset the offset whose line should be described 726 * @param offset the offset whose line should be described
727 * @return a region describing the line 727 * @return a region describing the line
728 * @exception BadLocationException if offset is invalid in this document 728 * @exception BadLocationException if offset is invalid in this document
729 */ 729 */
730 IRegion getLineInformationOfOffset(int offset) throws BadLocationException; 730 IRegion getLineInformationOfOffset(int offset) ;
731 731
732 /** 732 /**
733 * Returns the number of lines in this document 733 * Returns the number of lines in this document
734 * 734 *
735 * @return the number of lines in this document 735 * @return the number of lines in this document
742 * @param offset the offset of the specified text range 742 * @param offset the offset of the specified text range
743 * @param length the length of the specified text range 743 * @param length the length of the specified text range
744 * @return the number of lines occupied by the specified range 744 * @return the number of lines occupied by the specified range
745 * @exception BadLocationException if specified range is invalid in this tracker 745 * @exception BadLocationException if specified range is invalid in this tracker
746 */ 746 */
747 int getNumberOfLines(int offset, int length) throws BadLocationException; 747 int getNumberOfLines(int offset, int length) ;
748 748
749 /** 749 /**
750 * Computes the number of lines in the given text. For a given 750 * Computes the number of lines in the given text. For a given
751 * implementer of this interface this method returns the same 751 * implementer of this interface this method returns the same
752 * result as <code>set(text); getNumberOfLines()</code>. 752 * result as <code>set(text); getNumberOfLines()</code>.
772 * 772 *
773 * @param line the line of interest 773 * @param line the line of interest
774 * @return the line's delimiter or <code>null</code> if line does not have a delimiter 774 * @return the line's delimiter or <code>null</code> if line does not have a delimiter
775 * @exception BadLocationException if the line number is invalid in this document 775 * @exception BadLocationException if the line number is invalid in this document
776 */ 776 */
777 String getLineDelimiter(int line) throws BadLocationException; 777 String getLineDelimiter(int line) ;
778 778
779 779
780 /* ---------------------------- search ------------------------------------ */ 780 /* ---------------------------- search ------------------------------------ */
781 781
782 /** 782 /**
790 * defined by Character.isWhiteSpace 790 * defined by Character.isWhiteSpace
791 * @return the offset of the first occurrence of findString based on the parameters or -1 if no match is found 791 * @return the offset of the first occurrence of findString based on the parameters or -1 if no match is found
792 * @exception BadLocationException if startOffset is an invalid document offset 792 * @exception BadLocationException if startOffset is an invalid document offset
793 * @deprecated as of 3.0 search is provided by {@link FindReplaceDocumentAdapter} 793 * @deprecated as of 3.0 search is provided by {@link FindReplaceDocumentAdapter}
794 */ 794 */
795 int search(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) throws BadLocationException; 795 int search(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) ;
796 } 796 }