我有一个Label包裹在POJO中。所有外部操作都委托给标签。
我(在内部)将 a 挂钩DragSource到所述Label. 转移是LocalSelectionTransfer。
实施DragSourceAdapter:
@Override public void dragSetData(DragSourceEvent e)
{
transfer.setSelection(new StructuredSelection(this)); // *this* is the POJO wrapper
}
问题:
在放置事件(外部)上,如果我这样做
final Object newObj = ((StructuredSelection) transfer.getSelection()).getFirstElement();
newObj 将是POJO$1, 或POJO$2等等。
什么原因?为什么我没有得到一个instanceof POJO?