/** * set content * * @param text text * @deprecated use App. ... instead */ @Deprecated public static void setClipboard(String text) { App.setClipboard(text); }
/** * first does a click(target) at the given target position to gain focus/carret <br> and then pastes the text <br> * using the clipboard and strg/ctrl/cmd-v (paste keyboard shortcut) * * @param <PFRML> Pattern, Filename, Text, Region, Match or Location target * @param target Pattern, Filename, Text, Region, Match or Location * @param text a string, which might contain unicode characters * @return 1 if possible, 0 otherwise * @throws FindFailed if not found */ public <PFRML> int paste(PFRML target, String text) throws FindFailed { if (target != null && 0 == click(target, 0)) { return 0; } if (text != null) { App.setClipboard(text); int mod = Key.getHotkeyModifier(); IRobot r = getRobotForRegion(); r.keyDown(mod); r.keyDown(KeyEvent.VK_V); r.keyUp(KeyEvent.VK_V); r.keyUp(mod); return 1; } return 0; } //</editor-fold>