|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Clipboard
public class Clipboard
A mechanism allowing a user to copy data between programs.
Clipboards were originally for sharing data between different processes, but of course conventional practise these days is that cut, copy and paste are used quite ubiquitously both as a way to copy things from one program to another, as well as simply moving data around within an application.
You can copy text to the main system Clipboard quite simply, as follows:
clipboard = Clipboard.getDefault(); clipboard.setText("Hello there");
Nested Class Summary | |
---|---|
static interface |
Clipboard.OwnerChange
This signal is emitted any time the owner of the Clipboard [contents] changes. |
Method Summary | |
---|---|
void |
connect(Clipboard.OwnerChange handler)
Hook up a Clipboard.OwnerChange handler. |
static Clipboard |
getDefault()
Get the default Clipboard. |
String |
getText()
Get a textual representation of whatever is in this Clipboard. |
void |
setImage(Pixbuf pixbuf)
Copy the given image to this Clipboard. |
void |
setText(String text)
Copy the given text to this Clipboard. |
void |
store()
Request that the clipboard be copied somewhere outside your process's memory so that it will remain accessible to other applications after your process has terminated. |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void connect(Clipboard.OwnerChange handler)
Clipboard.OwnerChange
handler.
public static Clipboard getDefault()
There are actually quite a number of different clipboards in the X
server! Normal people are used to there only being one, and current
conventions are that the CLIPBOARD
clipboard is the
one that cut, copy, and paste operations go to. That is the clipboard
returned here.
public String getText()
This call blocks until the text is available, though the main loop may iterate while it is doing so.
The underlying implementation is actually asynchronous; a request for the data has to be made through the X server to whatever application actually placed the data in the clipboard.
public void setImage(Pixbuf pixbuf)
public void setText(String text)
public void store()
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |