Yes, the selection API along with the existing DOM API should let you do pretty much any of these manipulations based on cursor position, and probably more easily and robustly than what it sounds like you're describing using text strings. Also allows proper preservation of the cursor position - if you just change the html and replace it, cursor gets reset.
As for your second question, DeferredCommand would allow you run a function after all events are processed. jk On Apr 26, 7:21 pm, Navigateur <[email protected]> wrote: > If I could simply getCursorPos() in my RichTextArea according to the > text displayed (getText()), then I could use space boundaries between > words to discover the word that is being changed, and use simple > String replace methods to affect the HTML. But I really don't mind > knowing a position according to the HTML either! Pardon my ignorance, > but do you actually have the methods for me to do this with my > RichTextArea? > > But for me this is really all about the fact that any editing of the > text by the user (e.g. adding/deleting a character) happens AFTER the > keypress/keydown events are fired, so I cannot know WHAT the resulting > String will be!! This is crazy, and that's what necessitates me to > know the cursorPos, so that I can add the character being added/ > deleted (which is told to me by the keypress event) in its PROSPECTIVE > position (which, again, I have no way of knowing!!). > > So, for the time being, how do I do a time delayed function in GWT > i.e. what's the equivalent of JavaScript's "setInterval" in GWT? So > that I can grab the new and old Strings and compare them to know at > which cursor position I am. > > Regards, > N -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
