info.setTargetX(info.getDropX());
info.setTargetY(info.getDropY());
// Put the info in a Hashtable to post back
Hashtable<String, Object> params = new Hashtable<String, Object>();
params.put("sourceField", new ParameterHolder(info.getSourceField()));
params.put("sourceX", new ParameterHolder(info.getSourceX()));
params.put("sourceY", new ParameterHolder(info.getSourceX()));
params.put("targetX", new ParameterHolder(info.getTargetX()));
params.put("targetY", new ParameterHolder(info.getTargetY()));
params.put("dropX", new ParameterHolder(info.getDropX()));
params.put("dropY", new ParameterHolder(info.getDropY()));
params.put("targetField", new ParameterHolder(info.getTargetField()));
params.put("dropField", new ParameterHolder(info.getTargetField()));
params.put("sourceData", new ParameterHolder(info.getSourceData()));
params.put("sourceDataType", new ParameterHolder(info.getSourceDataType()));
// Post Event to the Target
Object postTarget;
if (ListViewListenerHelper.isMemberOfListView(info.getTargetField())) {
// if the target is a member of the listview then treat it as if it were the ListView
postTarget = ListViewListenerHelper.findListView(info.getTargetField());
} else if (info.getTargetField() instanceof OutlineFieldJTree) {
// if the target is a member of the OutlineField then treat it as if it were the OutlineField
postTarget = ((OutlineFieldJTree)info.getTargetField()).getOutlineField();
} else {
// default to TargetField
postTarget = info.getTargetField();
}
// CraigM:07/07/2008 - Handle multiple selection drag and drop for list views
if (info.getSourceField() instanceof ListView) {
ListView lv = (ListView)info.getSourceField();
Array_Of_DisplayNode<DisplayNode> nodes = lv.getSelectedNodes();
if (nodes.size() > 1) {
for (DisplayNode node : nodes) {
Hashtable<String, Object> newParams = (Hashtable<String, Object>)params.clone();
newParams.put("sourceData", new ParameterHolder(node));
ClientEventManager.postEvent(postTarget, eventName, newParams);
}
}
else {
ClientEventManager.postEvent(postTarget, eventName, params);
}
}
else {
ClientEventManager.postEvent(postTarget, eventName, params);
}
return true;
} catch (UnsupportedFlavorException ufe) {
System.out.println("importData: unsupported data flavor");
} catch (IOException ioe) {
System.out.println("importData: I/O exception");
}
}
if (fileListFlavor != null) {
try {
eventName = "FileDrop";
// Extract the File info - contained in an Array
List<File> droppedFiles = (List<File>) t.getTransferData(fileListFlavor);
Hashtable<String, Object> params = new Hashtable<String, Object>();
params.put("sourceData", new ParameterHolder(droppedFiles));
// Determine the Target
JComponent targetField = c;
Object postTarget;
if (ListViewListenerHelper.isMemberOfListView(targetField)) {