comparison dwt/custom/StyledTextContent.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents a5afe31f5cdd
children fd9c62a2998e
comparison
equal deleted inserted replaced
211:ff59aeb96cac 212:ab60f3309436
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2006 IBM Corporation and others. 2 * Copyright (c) 2000, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module dwt.custom.StyledTextContent; 13 module dwt.custom.StyledTextContent;
14 14
15 import dwt.custom.TextChangeListener; 15 import dwt.custom.TextChangeListener;
16 import dwt.dwthelper.utils;
17
16 /** 18 /**
17 * Clients may implement the StyledTextContent interface to provide a 19 * Clients may implement the StyledTextContent interface to provide a
18 * custom store for the StyledText widget content. The StyledText widget 20 * custom store for the StyledText widget content. The StyledText widget
19 * interacts with its StyledTextContent in order to access and update 21 * interacts with its StyledTextContent in order to access and update
20 * the text that is being displayed and edited in the widget. 22 * the text that is being displayed and edited in the widget.
51 * @param lineIndex index of the line to return. Does not include 53 * @param lineIndex index of the line to return. Does not include
52 * delimiters of preceding lines. Index 0 is the first line of the 54 * delimiters of preceding lines. Index 0 is the first line of the
53 * content. 55 * content.
54 * @return the line text without delimiters 56 * @return the line text without delimiters
55 */ 57 */
56 public char[] getLine(int lineIndex); 58 public String getLine(int lineIndex);
57 59
58 /** 60 /**
59 * Return the line index at the given character offset. 61 * Return the line index at the given character offset.
60 * <p> 62 * <p>
61 * 63 *
101 * <p> 103 * <p>
102 * 104 *
103 * @return the line delimiter that should be used by the StyledText widget 105 * @return the line delimiter that should be used by the StyledText widget
104 * when inserting new lines. 106 * when inserting new lines.
105 */ 107 */
106 public char[] getLineDelimiter(); 108 public String getLineDelimiter();
107 109
108 /** 110 /**
109 * Return the character offset of the first character of the given line. 111 * Return the character offset of the first character of the given line.
110 * <p> 112 * <p>
111 * <b>NOTE:</b> When there is no text (i.e., no lines), getOffsetAtLine(0) 113 * <b>NOTE:</b> When there is no text (i.e., no lines), getOffsetAtLine(0)
132 * @param start the start offset of the text to return. Offset 0 is the 134 * @param start the start offset of the text to return. Offset 0 is the
133 * first character of the document. 135 * first character of the document.
134 * @param length the length of the text to return 136 * @param length the length of the text to return
135 * @return the text at the given range 137 * @return the text at the given range
136 */ 138 */
137 public char[] getTextRange(int start, int length); 139 public String getTextRange(int start, int length);
138 140
139 /** 141 /**
140 * Remove the specified text changed listener. 142 * Remove the specified text changed listener.
141 * <p> 143 * <p>
142 * 144 *
190 * document 192 * document
191 * @param replaceLength length of text to replace 193 * @param replaceLength length of text to replace
192 * @param text text to replace 194 * @param text text to replace
193 * @see TextChangeListener 195 * @see TextChangeListener
194 */ 196 */
195 public void replaceTextRange(int start, int replaceLength, char[] text); 197 public void replaceTextRange(int start, int replaceLength, String text);
196 198
197 /** 199 /**
198 * Set text to "text". 200 * Set text to "text".
199 * Implementors have to send a <code>TextChangedEvent</code> to the 201 * Implementors have to send a <code>TextChangedEvent</code> to the
200 * textSet method of the TextChangeListeners that were added using 202 * textSet method of the TextChangeListeners that were added using
202 * <p> 204 * <p>
203 * 205 *
204 * @param text the new text 206 * @param text the new text
205 * @see TextChangeListener 207 * @see TextChangeListener
206 */ 208 */
207 public void setText(char[] text); 209 public void setText(String text);
208 } 210 }