开发者

How do I simulate browser 'select-all' in GWT

开发者 https://www.devze.com 2023-02-03 05:05 出处:网络
开发者_JAVA技巧I\'ve got a GWT application that displays largely text spans.I\'d like to programatically select all of the text currently in the browser window (similar to pressingfrom the browser men

开发者_JAVA技巧I've got a GWT application that displays largely text spans. I'd like to programatically select all of the text currently in the browser window (similar to pressing from the browser menu).

Can anybody give me a pointer to this? cheers, Ian


The select all function is not available for the entire DOM, however there is a selectAll message for TextBoxBase, so what is commonly used for large quantities of text where you automatically want to do a select all is to put the text inside a TextArea. If you don't like the look you can remove the borders from the text area and set it to read-only so that it would appear as just plain text.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号