I have embedded the tinymce editor in javafx WebWiew. I load the editor using the webEngine.load method. Problems arise when copying paste. When I copy some content from notepad to tinymce, it is pasted. Then, when I copy some content from tinymce to tinymce, it is pasted. No problems. But as soon as I inserted some content from tinyme to tinymce, I can no longer copy tinymce (webView) from abroad. For example, when I copy text from a notepad and paste, the value copied from the notepad is ignored, and the previous value copied from tinymce is pasted again.
I added a listener to the webView and checked the clipboard values, they are correct in all cases:
webView.addEventHandler(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent arg0) { if (arg0.isControlDown() && arg0.getCode() == KeyCode.V) { final ClipBoard clipBoard = ClipBoard.getSystemClipBoard(); System.out.println(clipBoard.getContent(DataFormat.PLAIN_TEXT)); ..
And on the editor side, by initializing the TinyMCE editor: As you can see in the third attempt, args.content is erroneous and does not contain a value on the clipboard.
tinymce.init { paste_preprocess : function(plugin,args) { debug(args.content);
Step 1: [OK]
value copied from notepad ABCDE
java system out for clipboard: ABCDE
editor html debug says: ABCDE
Step 2: [OK]
value copied from tinymce XYZQ editor
java system out for clipboard: XYZQ
html debug editor says: XYZQ
Step 3: [FAIL]
value copied from notepad ASDFG
java system out for clipboard: ASDFG
html debug editor says: XYZQ
Properties of the system:
TinyMCE 4.2.2
Windows 7
The problem occurs in java 1.8.65 and 1.8.66
The problem does not occur in java 1.7.40
Solution: I can manually send content from java to javafx (editor) using executable scripts, etc. And override the value in the paste_preprocess function for tinymce. But why is this happening? (The case does not occur on java 1.7). There must be a better solution.