Clipboard
A wrapper for coping and pasting text. Within a JVM, it uses AWT's Clipboard class. Within a Browser, it uses window.navigator.clipboard
.
Glok doesn't currently support copy/paste of other data types.
This interface was first designed to work in a JVM context, where it was possible to monitor the state of the clipboard. This isn't possible within a Javascript application, therefore containsText always returns true. This means that application's Edit
menus will never have disabled items for Paste
(even when the clipboard contains no text).
NOTE. For security reasons, when the user initiates a paste
operation, the browser will likely ask the user for consent. In Firefox, a small pop-up menu appears every time, with a single menu item labelled "Paste". In Chrome, it is a pop-up dialog which with the options al Allow
or Block
. This only appears once, not for every paste operation. These may be affected by browser settings.
Exposes the system clipboard for copy/paste operations.
Currently only text is supported.
Get/set the contents of text using textContents.
Properties
Does the clipboard currently contain text.
Does the clipboard currently contain text.
Does the clipboard currently contain text.
The opposite of containsTextProperty. Use this as the disabledProperty
for Paste
menu items/buttons.
The opposite of containsTextProperty. Use this as the disabledProperty
for paste actions.
The opposite of containsTextProperty. Use this as the disabledProperty
for paste actions.
Functions
Copies text to the system's clipboard, where it can be used by any application (including this one).