Hello forum,
i tried to implement drag and drop but i am struggling with the drop functionality of my extended CommonNavigator.
I read some examples about darg and drop between two views of one plugin, both derived from ViewPart and I tested a dropAction implementing IDropActionDelegate to communicate between different plugins.
Both examples are working but I have one view derived from ViewPart like:
int ops = DND.DROP_MOVE | DND.DROP_COPY;
Transfer[] transfers = new Transfer[] { RequirementTransfer.getInstance()/*, PluginTransfer.getInstance()*/ };
viewer.addDragSupport( ops, transfers, new RequirementDragListener( viewer ) );
and another view defined in plugin.xml like here: scribbledideas.blogspot.de/2006/05/building-common-navigator-based-viewer.html
I tried to specify an drop assistant because there occurs an exception that the drop target can not be initialized, if I use the common view of the common navigator like in the first view to add drop support.
<dropAssistant
class="requirementsplugin.views.dnd.DropAdapterAssistent"
id="requirementsplugin.views.dnd.requirement">
<possibleDropTargets>
<and>
<adapt
type="requirementsplugin.datatypes.RequirementTreeLeaf">
</adapt>
<adapt
type="requirementsplugin.datatypes.Requirement">
</adapt>
</and>
</possibleDropTargets>
</dropAssistant>
The problem is that my drop assistant is not used by the related view.
Is there any way to set a ViewerDropAdapter to view derived from CommonNavigator?
The class CommonDropAdapter is final. So it is useless to overwrite the method of CommonView which creates the CommonDropAdapter.
What is the correct way to implement drag and drop in my scenario?
Is there any example available?
Note: The common navigator should enable dropping only for objects of a special class (I created a class which extends ByteArrayTransfer).
Thanks for your help!
Michael
[Updated on: Tue, 30 April 2013 04:16]
Report message to a moderator