Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse Drag and Drop - ViewPart to CommonNavigator
icon5.gif  Eclipse Drag and Drop - ViewPart to CommonNavigator [message #1051988] Mon, 29 April 2013 13:30
Michael Genau is currently offline Michael GenauFriend
Messages: 9
Registered: April 2013
Junior Member
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

Previous Topic:FilteredTree: ClassCastException: FilteredTree cannot be cast to org.eclipse.swt.widgets.Tree
Next Topic:Generic Debug Framework
Goto Forum:
  


Current Time: Thu Dec 18 11:32:44 GMT 2014

Powered by FUDForum. Page generated in 0.02154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software