如何在GWT TextArea中启用光标选择器? [英] How to enable cursor selector in GWT TextArea?

查看:403
本文介绍了如何在GWT TextArea中启用光标选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我调用一个API来获取文件的内容作为一个字符串,并使用TextArea UIWidget显示文件内容给用户。

In my application I call an API to get the contents of the file as a String and use the TextArea UIWidget to display the file content to the user.

希望用户能够选择文本区域中的文本,以便能够复制和粘贴文件的内容。当我将鼠标悬停在GWT中的TextArea上时,未启用文本选择。 TextArea中的getCursorPos函数似乎在修改textarea但不适用于选择时很有用


I want the user to be able to select the text in the text area in order to be able to copy and paste the contents of the file. When I hover over the TextArea in GWT, text selection is not being enabled. The getCursorPos function in the TextArea seems to be useful when modifying the textarea but not for selections

推荐答案

TextArea中默认启用文本选择。您可以禁用它 setEnabled(false),或者在TextArea之上放置另一个小部件(面板),以防止用户输入或选择文本。

Text selection is enabled in TextArea by default. You either disabled it somewhere setEnabled(false), or you put another widget (panel) on top of your TextArea which prevents users from typing in or selecting a text.

这篇关于如何在GWT TextArea中启用光标选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆