Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Tree viewer and Drag and Drop DND.DND_COPY
Tree viewer and Drag and Drop DND.DND_COPY [message #212453] Thu, 23 March 2006 08:31 Go to next message
Eclipse UserFriend
Originally posted by: mateu.yabar.justinmind.com

Hi,

I want to use drag and drop between trees (treeviewers) and I have found
that when I try to use the DND_COPY (DnD with control key) it doesn't work.
I've been looking for a while and I have seen that this doesn't work because
TreeViewerTransferDropListener doesn't enable it:
public boolean isEnabled(DropTargetEvent event) {

if (event.detail != DND.DROP_MOVE)

return false;

return super.isEnabled(event);

It is impossible to extend TreeViewerTransferDropListener because its a
private class. What I'm doing now is copying the
TreeViewerTransferDropListener source code and changing it to achive this
results. However I think that it should be a better way to do it. Any
suggestions?



Thanks
Re: Tree viewer and Drag and Drop DND.DND_COPY [message #212587 is a reply to message #212453] Mon, 27 March 2006 19:30 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Basically, you have to do what you said. Note that in many cases the drop
listener implicitly changes the operation to a COPY. You can do this as well
in your code.

"exquisitus" <mateu.yabar@justinmind.com> wrote in message
news:dvtmd5$ic9$1@utils.eclipse.org...
> Hi,
>
> I want to use drag and drop between trees (treeviewers) and I have found
> that when I try to use the DND_COPY (DnD with control key) it doesn't
> work. I've been looking for a while and I have seen that this doesn't work
> because TreeViewerTransferDropListener doesn't enable it:
> public boolean isEnabled(DropTargetEvent event) {
>
> if (event.detail != DND.DROP_MOVE)
>
> return false;
>
> return super.isEnabled(event);
>
> It is impossible to extend TreeViewerTransferDropListener because its a
> private class. What I'm doing now is copying the
> TreeViewerTransferDropListener source code and changing it to achive this
> results. However I think that it should be a better way to do it. Any
> suggestions?
>
>
>
> Thanks
>
>
Previous Topic:GEF Popup Toolbar
Next Topic:Eclipse Commands != GEF Commands?
Goto Forum:
  


Current Time: Thu Apr 25 23:57:51 GMT 2024

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

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

Back to the top