Tree viewer and Drag and Drop DND.DND_COPY [message #212453] |
Thu, 23 March 2006 08:31 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02827 seconds