【发布时间】:2013-08-08 07:20:29
【问题描述】:
我有一个 Label 包裹在 POJO 中。所有外部操作都委托给标签。
我(内部)将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?
【问题讨论】:
标签: java drag-and-drop swt jface