Re: Is it possible to use the new Clipboard API in a GWT app? It depends on document.hasFocus being true.

2023-01-03 Thread Pramod Patil
I tried all things, below is the actual flow of code where I need clipboard copied text, upon click on tool icon below function gets called, protected Function pasteFromExcelFunction =new Function(){ public void execute(){ if(readOnly){ return; }// its false try{ if

Re: Is it possible to use the new Clipboard API in a GWT app? It depends on document.hasFocus being true.

2023-01-03 Thread Craig Mitchell
? That is the Java code. readTextButton.addClickHandler(event -> { readText(text -> { // Do whatever you want with the text, eg: GWT.log("The text: " + text); }); }); (assuming you are running Java8 or later) The readText is your JSNI call. On Wednesday, 4 January 2023 at 1:18:31 p

Re: Is it possible to use the new Clipboard API in a GWT app? It depends on document.hasFocus being true.

2023-01-03 Thread Pramod Patil
I am not sure if I can call Java code readText(text -> { // Do whatever you want with the text, eg: GWT.log("The text: " + text);// can I call Java code here to process this string? }); On Wed, 4 Jan 2023, 4:00 am Craig Mitchell, wrote: > readText(text -> { >// Do whatever you want wit

Re: Is it possible to use the new Clipboard API in a GWT app? It depends on document.hasFocus being true.

2023-01-03 Thread Craig Mitchell
readText(text -> { // Do whatever you want with the text, eg: GWT.log("The text: " + text); }); Note: It is returned asynchronously (not from the return statement), so you'll probably need to modify your calling code to cater for that. On Wednesday, 4 January 2023 at 3:40:05 am UTC+11 pat

Re: Is it possible to use the new Clipboard API in a GWT app? It depends on document.hasFocus being true.

2023-01-03 Thread Pramod Patil
Hi @Craig Mitchell, You were right about script, The above script posted by me seems to have issues, below is the working script, I am not getting any compiler errors but neither getting any string as return value. I am testing things using below code, readTextButton.addClickHandler(new ClickHandl