JxBrowser provides functionality that allows you to execute commands such as "Cut", "Copy", "Paste", "Undo", "Redo", "Insert Text", etc. on the loaded web page. JxBrowser supports two types of commands: simple commands (e.g. "Copy", "Cut", "Paste") and parametrized commands ("InsertText", "FindString", etc.).(JxBrowser提供的功能使您可以在加载的网页上执行“剪切”,“复制”,“粘贴”,“撤消”,“重做”,“插入文本”等命令。 JxBrowser支持两种类型的命令:简单命令(例如“复制”,“剪切”,“粘贴”)和参数化命令(“ InsertText”,“ FindString”等)。)
Most of commands can be executed only in a WYSIWYG editor (e.g. "FontSize", "ForegroundColor", "Bold", etc.), HTML text filed or text area ("InsertText", "Cut", "Delete", etc.).(大多数命令只能在WYSIWYG编辑器中执行(例如“ FontSize”,“ ForegroundColor”,“ Bold”等),HTML文本字段或文本区域(“ InsertText”,“ Cut”,“ Delete”等)。 )。)
To execute command you need to use the Browser.executeCommand(EditorCommand command) method to execute simple commands or the Browser.executeCommand(EditorCommand command, String value) method to execute parameterised command. (要执行命令,您需要使用Browser.executeCommand(EditorCommand command)方法执行简单命令,或使用Browser.executeCommand(EditorCommand command,String value)方法执行参数化命令。)
browser.executeCommand(EditorCommand.SELECT_ALL); browser.executeCommand(EditorCommand.COPY); browser.executeCommand(EditorCommand.CUT); browser.executeCommand(EditorCommand.PASTE); browser.executeCommand(EditorCommand.INSERT_TEXT, "Text");
The list of all supported commands you can find in the EditorCommand enum.(您可以在EditorCommand枚举中找到所有受支持命令的列表。)