if (display == null) DND.error(SWT.ERROR_WIDGET_DISPOSED); if (display.isDisposed()) DND.error(SWT.ERROR_DEVICE_DISPOSED);
checkWidget();
public Object getContents(Transfer transfer) {	if (display == null) DND.error(SWT.ERROR_WIDGET_DISPOSED);	if (display.isDisposed()) DND.error(SWT.ERROR_DEVICE_DISPOSED);	if (transfer == null) DND.error(SWT.ERROR_NULL_ARGUMENT);		int[] scrap = new int[1];	if (OS.GetCurrentScrap(scrap) != OS.noErr) return null;	int[] typeIds = transfer.getTypeIds();	int[] size = new int[1];		// get data from system clipboard	for (int i=0; i<typeIds.length; i++) {		int type = typeIds[i];		size[0] = 0;		if (OS.GetScrapFlavorSize(scrap[0], type, size) == OS.noErr && size[0] > 0) {			byte[] buffer = new byte[size[0]];			if (OS.GetScrapFlavorData(scrap[0], type, size, buffer) == OS.noErr) {				TransferData tdata = new TransferData();				tdata.type = type;						tdata.data = new byte[1][];				tdata.data[0] = buffer;				return transfer.nativeToJava(tdata);			}		}	}	return null;	// No data available for this transfer}