try { notifyListeners(DND.DropAccept,event); } catch (Throwable err) { event.detail = DND.DROP_NONE; event.dataType = null; }
private boolean drag_drop(int /*long*/ widget, int /*long*/ context, int x, int y, int time) {	DNDEvent event = new DNDEvent();	if (!setEventData(context, x, y, time, event)) {		keyOperation = -1;		return false;	}	keyOperation = -1;		int allowedOperations = event.operations;	TransferData[] allowedDataTypes = new TransferData[event.dataTypes.length];	System.arraycopy(event.dataTypes, 0, allowedDataTypes, 0, allowedDataTypes.length);		event.dataType = selectedDataType;	event.detail = selectedOperation;	try {		notifyListeners(DND.DropAccept,event);	} catch (Throwable err) {		event.detail = DND.DROP_NONE;		event.dataType = null;	}	selectedDataType = null;	if (event.dataType != null) {		for (int i = 0; i < allowedDataTypes.length; i++) {			if (allowedDataTypes[i].type == event.dataType.type) {				selectedDataType = allowedDataTypes[i];				break;			}		}	}		selectedOperation = DND.DROP_NONE;	if (selectedDataType != null && ((event.detail & allowedOperations) == event.detail)) {		selectedOperation = event.detail;	}		if (selectedOperation == DND.DROP_NONE) {		// this was not a successful drop		return false;	}	// ask drag source for dropped data	OS.gtk_drag_get_data(widget, context, selectedDataType.type, time);	return true;}