Changeset 212:ab60f3309436 for dwt/custom/DefaultContent.d
- Timestamp:
- 05/04/08 18:12:38 (7 months ago)
- Files:
-
- dwt/custom/DefaultContent.d (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/DefaultContent.d
r155 r212 30 30 31 31 class DefaultContent : StyledTextContent { 32 private final static char[]LineDelimiter = tango.io.FileConst.FileConst.NewlineString;32 private final static String LineDelimiter = tango.io.FileConst.FileConst.NewlineString; 33 33 34 34 StyledTextListener[] textListeners; // stores text listeners for event sending 35 char[]textStore; // stores the actual text35 String textStore; // stores the actual text 36 36 int gapStart = -1; // the character position start of the gap 37 37 int gapEnd = -1; // the character position after the end of the gap … … 188 188 * @return a bool specifying whether or not the replace operation is valid 189 189 */ 190 protected bool isValidReplace(int start, int replaceLength, char[]newText){190 protected bool isValidReplace(int start, int replaceLength, String newText){ 191 191 if (replaceLength is 0) { 192 192 // inserting text, see if the \r\n line delimiter is being split … … 273 273 * @param text the text to insert 274 274 */ 275 void insert(int position, char[]text) {275 void insert(int position, String text) { 276 276 if (text.length is 0) return; 277 277 … … 455 455 * @return number of lines in the text 456 456 */ 457 int lineCount( char[]text){457 int lineCount(String text){ 458 458 int lineCount_ = 0; 459 459 int length = text.length; … … 488 488 * </ul> 489 489 */ 490 public char[]getLine(int index) {490 public String getLine(int index) { 491 491 if ((index >= lineCount_) || (index < 0)) error(DWT.ERROR_INVALID_ARGUMENT); 492 492 int start = lines[index][0]; … … 521 521 * system property. 522 522 */ 523 public char[]getLineDelimiter() {523 public String getLineDelimiter() { 524 524 return LineDelimiter; 525 525 } … … 530 530 * @return the logical line text (i.e., without the gap) with delimiters 531 531 */ 532 char[]getFullLine(int index) {532 String getFullLine(int index) { 533 533 int start = lines[index][0]; 534 534 int length_ = lines[index][1]; … … 553 553 * @return the physical line 554 554 */ 555 char[]getPhysicalLine(int index) {555 String getPhysicalLine(int index) { 556 556 int start = lines[index][0]; 557 557 int length_ = lines[index][1]; … … 701 701 * @return the text 702 702 */ 703 char[]getPhysicalText(int start, int length_) {703 String getPhysicalText(int start, int length_) { 704 704 return textStore[ start .. start + length_ ].dup; 705 705 } … … 713 713 * @return the text 714 714 */ 715 public char[]getTextRange(int start, int length_) {715 public String getTextRange(int start, int length_) { 716 716 if (textStore is null) 717 717 return ""; … … 776 776 * </ul> 777 777 */ 778 public void replaceTextRange(int start, int replaceLength, char[]newText){778 public void replaceTextRange(int start, int replaceLength, String newText){ 779 779 // check for invalid replace operations 780 780 if (!isValidReplace(start, replaceLength, newText)) DWT.error(DWT.ERROR_INVALID_ARGUMENT); … … 815 815 * @param text the text 816 816 */ 817 public void setText ( char[]text){817 public void setText (String text){ 818 818 textStore = text.dup; 819 819 gapStart = -1; … … 840 840 int endLine = getLineAtOffset(position + length_); 841 841 842 char[]endText = "";842 String endText = ""; 843 843 bool splittingDelimiter = false; 844 844 if (position + length_ < getCharCount()) {
