if (display.getThread() != Thread.currentThread()) { DND.error(SWT.ERROR_THREAD_INVALID_ACCESS); } this.display = display;  int widgetClass = OS.topLevelShellWidgetClass (); shellHandle = OS.XtAppCreateShell (null, null, widgetClass, display.xDisplay, null, 0); OS.XtSetMappedWhenManaged (shellHandle, false); OS.XtRealizeWidget (shellHandle); int xDisplay = OS.XtDisplay(shellHandle); clipboardAtom = OS.XmInternAtom(xDisplay, CLIPBOARD, false); primaryAtom = OS.XmInternAtom(xDisplay, PRIMARY, false); targetsAtom = OS.XmInternAtom(xDisplay, TARGETS, false); }
public Clipboard(Display display) {		checkSubclass ();	if (display == null) {		display = Display.getCurrent();		if (display == null) {			display = Display.getDefault();		}	}	if (display.getThread() != Thread.currentThread()) {		DND.error(SWT.ERROR_THREAD_INVALID_ACCESS);	}	this.display = display;		int widgetClass = OS.topLevelShellWidgetClass ();	shellHandle = OS.XtAppCreateShell (null, null, widgetClass, display.xDisplay, null, 0);	OS.XtSetMappedWhenManaged (shellHandle, false);	OS.XtRealizeWidget (shellHandle);	int xDisplay = OS.XtDisplay(shellHandle);	clipboardAtom = OS.XmInternAtom(xDisplay, CLIPBOARD, false);	primaryAtom = OS.XmInternAtom(xDisplay, PRIMARY, false);	targetsAtom = OS.XmInternAtom(xDisplay, TARGETS, false);}