Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 45771

Summary: Cannot set clipboard content to empty string
Product: [Eclipse Project] Platform Reporter: Grant Gayed <grant_gayed>
Component: SWTAssignee: Veronika Irvine <veronika_irvine>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux-Motif   
Whiteboard:

Description Grant Gayed CLA 2003-10-29 18:21:19 EST
The following snippet works on win32, but on motif it throws the shown exception:

public static void main(String[] args) {
	Display display = new Display();
	Clipboard clipboard = new Clipboard(display);
	TextTransfer transfer = TextTransfer.getInstance();
	clipboard.setContents(new String[]{""}, new Transfer[]{transfer});
}

Exception in thread "main" org.eclipse.swt.SWTError: Cannot set data in clipboard
	at org.eclipse.swt.dnd.DND.error(DND.java:225)
	at org.eclipse.swt.dnd.DND.error(DND.java:181)
	at org.eclipse.swt.dnd.Clipboard.setContents(Clipboard.java:291)
Comment 1 Veronika Irvine CLA 2003-10-30 08:32:40 EST
It is my intention to make Windows throw the same exception.  Unfortunately, 
Windows does the action asynchronously so I need to figure out a way to make 
this happen.
Comment 2 Veronika Irvine CLA 2004-06-15 12:19:26 EDT

*** This bug has been marked as a duplicate of 65406 ***