APIdia Launch Partner
Top Description Constructors Methods
com.badlogic.gdx.backends.lwjgl

public Class LwjglClipboard

extends Object
implements Clipboard, ClipboardOwner
Class Inheritance
All Implemented Interfaces
java.awt.datatransfer.ClipboardOwner, com.badlogic.gdx.utils.Clipboard
Imports
java.awt.Toolkit, java.awt.datatransfer.ClipboardOwner, .DataFlavor, .StringSelection, .Transferable, java.io.File, java.util.List, com.badlogic.gdx.utils.Clipboard

Clipboard implementation for desktop that uses the system clipboard via the default AWT Toolkit.
Author
mzechner

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getContents()

Implements com.badlogic.gdx.utils.Clipboard.getContents.

gets the current content of the clipboard if it contains text for WebGL app, getting the system clipboard is currently not supported.

public boolean
hasContents()

Implements com.badlogic.gdx.utils.Clipboard.hasContents.

Check if the clipboard has contents.

public void
lostOwnership(Clipboard arg0, Transferable arg1)

Implements java.awt.datatransfer.ClipboardOwner.lostOwnership.

Notifies this object that it is no longer the clipboard owner.

public void
setContents(String content)

Implements com.badlogic.gdx.utils.Clipboard.setContents.

Sets the content of the system clipboard.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LwjglClipboardback to summary
public LwjglClipboard()

Method Detail

getContentsback to summary
public String getContents()

Implements com.badlogic.gdx.utils.Clipboard.getContents.

Doc from com.badlogic.gdx.utils.Clipboard.getContents.

gets the current content of the clipboard if it contains text for WebGL app, getting the system clipboard is currently not supported. It works only inside the app

Annotations
@Override
hasContentsback to summary
public boolean hasContents()

Implements com.badlogic.gdx.utils.Clipboard.hasContents.

Doc from com.badlogic.gdx.utils.Clipboard.hasContents.

Check if the clipboard has contents. Recommended to use over getContents() for privacy reasons, if you only want to check if there's something on the clipboard. For instance, calling getContents() on iOS shows a privacy notification since iOS 14, while hasContents() does not.

Annotations
@Override
lostOwnershipback to summary
public void lostOwnership(Clipboard arg0, Transferable arg1)

Implements java.awt.datatransfer.ClipboardOwner.lostOwnership.

Doc from java.awt.datatransfer.ClipboardOwner.lostOwnership.

Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.

Annotations
@Override
setContentsback to summary
public void setContents(String content)

Implements com.badlogic.gdx.utils.Clipboard.setContents.

Doc from com.badlogic.gdx.utils.Clipboard.setContents.

Sets the content of the system clipboard. for WebGL app, clipboard content might not be set if user denied permission, setting clipboard is not synchronous so you can't rely on getting same content just after setting it

Annotations
@Override