Changeset 631


Ignore:
Timestamp:
12/17/13 15:32:48 (11 years ago)
Author:
csl14
Message:

fixed javafx browser copy text bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/widgets/JfxBrowser.java

    r627 r631  
    354354                                                                        String selection = (String) JavaFX.WebEngineExecuteScript.invoke(JavaFX.WebViewGetEngine.invoke(webview), "window.getSelection().toString()");
    355355
    356                                                                                 // Copy text and attach to cursor
    357                                                                                 Text t = new Text(selection);
    358                                                                                 t.setParent(DisplayIO.getCurrentFrame());
    359                                                                                 t.setXY(FrameMouseActions.getX(), FrameMouseActions.getY());
    360                                                                                 FrameMouseActions.pickup(t);
     356                                                                        // Do nothing if no text is selected
     357                                                                        if(!selection.equals("")) {
     358                                                                                // Copy text and attach to cursor
     359                                                                                        Text t = new Text(selection);
     360                                                                                        t.setParent(DisplayIO.getCurrentFrame());
     361                                                                                        t.setXY(FrameMouseActions.getX(), FrameMouseActions.getY());
     362                                                                                        FrameMouseActions.pickup(t);
     363                                                                        } else { System.out.println("no text selected"); }
    361364                                                                }
    362365                                                        }
Note: See TracChangeset for help on using the changeset viewer.