java - JFace different instances of dropped POJO -
i have label
wrapped in pojo. external operations delegated label.
i (internally) hook dragsource
said label
. transfer localselectiontransfer
.
implementation of dragsourceadapter
:
@override public void dragsetdata(dragsourceevent e) { transfer.setselection(new structuredselection(this)); // *this* pojo wrapper }
question:
on drop events (externally), if
final object newobj = ((structuredselection) transfer.getselection()).getfirstelement();
newobj pojo$1
, or pojo$2
etc.
what's reason? why don't instanceof pojo
?
as say, new structuredselection(this)
inside implementation of dragsourceadapter
, this
implementation (an anonymous inner class of "pojo") instead of pojo itself! need instead new structuredselection(pojo.this)
refer outer instance (obviously, replace pojo
actual name of class).
a bit of aside, wouldn't call class concerned gui directly "pojo".
Comments
Post a Comment