try { notifyListeners(DND.DropAccept,event); } catch (Throwable e) { event.detail = DND.DROP_NONE; event.dataType = null; }
notifyListeners(DND.DropAccept,event);
private int Drop(int pDataObject, int grfKeyState, int pt_x, int pt_y, int pdwEffect) {	effect.show(DND.FEEDBACK_NONE, 0, 0);	DNDEvent event = new DNDEvent();	event.widget = this;	event.time = OS.GetMessageTime();	event.detail = DND.DROP_NONE;	try {		notifyListeners(DND.DragLeave, event);	} catch (Throwable e) {}		event = new DNDEvent();	if (!setEventData(event, pDataObject, grfKeyState, pt_x, pt_y, pdwEffect)) {		keyOperation = -1;		OS.MoveMemory(pdwEffect, new int[] {COM.DROPEFFECT_NONE}, 4);		return COM.S_OK;	}	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 e) {		event.detail = DND.DROP_NONE;		event.dataType = null;	}	selectedDataType = null;	for (int i = 0; i < allowedDataTypes.length; i++) {		if (TransferData.sameType(allowedDataTypes[i], event.dataType)){			selectedDataType = allowedDataTypes[i];			break;		}	}	selectedOperation = DND.DROP_NONE;	if (selectedDataType != null && (allowedOperations & event.detail) == event.detail) {		selectedOperation = event.detail;	}	if (selectedOperation == DND.DROP_NONE){		OS.MoveMemory(pdwEffect, new int[] {COM.DROPEFFECT_NONE}, 4);			return COM.S_OK;	}		// Get Data in a Java format	Object object = null;	for (int i = 0; i < transferAgents.length; i++){		if (transferAgents[i].isSupportedType(selectedDataType)){			object = transferAgents[i].nativeToJava(selectedDataType);			break;		}	}	if (object == null){		selectedOperation = DND.DROP_NONE;	}		event.detail = selectedOperation;	event.dataType = selectedDataType;	event.data = object;	try {		notifyListeners(DND.Drop,event);		selectedOperation = DND.DROP_NONE;		if ((allowedOperations & event.detail) == event.detail) {			selectedOperation = event.detail;		}	} catch (Throwable e) {		selectedOperation = DND.DROP_NONE;	}		//notify source of action taken			OS.MoveMemory(pdwEffect, new int[] {opToOs(selectedOperation)}, 4);		return COM.S_OK;}