Hi Thomas,

On a closer look, indeed that doesn't help you much. I am not an expert on
the topic, but I guess the answer is you cannot.
I looked at the win32 implementation and some windows API documentation
[1]. To be able to detect that a move was requested, the
CFSTR_PREFERREDDROPEFFECT data should be extracted and examined. This data
field seems only to be referenced in DragSource, so I don't think this
functionality is implemented in the win32 SWT. Moreover, when I cut a file
in the file explorer and paste it in Eclipse: The file is marked as cut in
the file explorer, the file is copied to Eclipse, the file remains marked
as cut in the file explorer. This is another clue that this is not
implemented.

[1]
https://docs.microsoft.com/en-us/windows/win32/shell/datascenarios#handling-delete-on-paste-operations

Op di 26 jan. 2021 om 20:52 schreef Thomas Singer <ts-...@syntevo.com>:

> Hi Rolf,
>
> Sorry, I don't understand how this answers my question. The normal text
> copy-paste I understand. I also understand how to retrieve the copied
> file paths (FileTransfer), but how to find out whether an application
> has cut or copied it? For drag and drop operations this information is
> stored in the DropTargetEvent.detail, but the Clipboard does not have
> this information. Neither a listener is missing to tell the process
> which puts the file into the clipboard that it was pasted.
>
> --
> Best regards,
> Thomas Singer
>
>
> On 2021-01-26 19:35, Rolf Theunissen wrote:
> > Hi Thomas,
> >
> > The copy-past behavior is implemented with the drag-and-drop API of SWT.
> > Specifically, the Clipboard and FileTransfer are of interest for the
> > copy-pasting of files.
> > Have a look at this article as a starter:
> >
> https://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html#_Using_the_Clipboard
> >
> > Best Regards,
> > Rolf
> >
> > Op di 26 jan. 2021 om 11:29 schreef Thomas Singer <ts-...@syntevo.com>:
> >
> >> Hi,
> >>
> >> For text everything works as expected. Cutting a text immediately
> >> removes it from the text control (it is stored in the clipboard) and on
> >> paste it will be inserted.
> >>
> >> But I'm trying to understand how to handle a typical file manager
> >> workflow: a user selects a file in the Windows Explorer, invokes Cut
> >> (Ctrl+X) and in an SWT-based application pastes the file. How can the
> >> SWT-based application find out whether the file was cut or copied?
> >>
> >> --
> >> Best regards,
> >> Thomas Singer
> >> _______________________________________________
> >> platform-dev mailing list
> >> platform-dev@eclipse.org
> >> To unsubscribe from this list, visit
> >> https://www.eclipse.org/mailman/listinfo/platform-dev
> >>
> >
> >
> > _______________________________________________
> > platform-dev mailing list
> > platform-dev@eclipse.org
> > To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/platform-dev
> >
> _______________________________________________
> platform-dev mailing list
> platform-dev@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/platform-dev
>
_______________________________________________
platform-dev mailing list
platform-dev@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/platform-dev

Reply via email to