Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag and Drop files to RCP app not working on Linux?
Drag and Drop files to RCP app not working on Linux? [message #452747] Thu, 24 March 2005 12:28 Go to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
Hi,

drag and dropping native files from Windows desktop to my Eclipse RCP
application works just fine on Windows, but not on my version of Linux
(SimplyMEPIS 3.3 using Konqueror and KDE) - I get no drag/drop events at all
dragging files from Konqueror to my RCP app. Are there issues?

Phil
Re: Drag and Drop files to RCP app not working on Linux? [message #452758 is a reply to message #452747] Thu, 24 March 2005 13:40 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Are you registering for the type FileTransfer? There does not seem to be a
standard format used by the various file manipulation tools on Linux. I
have implemented support for text/uri-list but it appears that many
applications have their own formats such as x-special/gnome-copied-files. I
need to investigate more of these formats and see if I can support them.
You can run the ClipboardExample (org.eclipse.swt.examples) and it will show
you a list of formats that have been placed on the Clipboard when you copy a
file from one of the external tools. Drag and Drop generally supports the
same formats as the clipboard. Enter a bug report against Platform SWT if
there is a specific format you want to see supported. (e.g. see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=86569)

"Phillip Beauvoir" <p.beauvoir@bolton.ac.uk> wrote in message
news:d1ugh1$9kr$1@news.eclipse.org...
> Hi,
>
> drag and dropping native files from Windows desktop to my Eclipse RCP
> application works just fine on Windows, but not on my version of Linux
> (SimplyMEPIS 3.3 using Konqueror and KDE) - I get no drag/drop events at
> all dragging files from Konqueror to my RCP app. Are there issues?
>
> Phil
>
>
Re: Drag and Drop files to RCP app not working on Linux? [message #452761 is a reply to message #452758] Thu, 24 March 2005 14:44 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
Hi,

yes I've been using FileTransfer:

protected void registerDragDrop() {

int operations = DND.DROP_COPY | DND.DROP_DEFAULT;
DropTarget target = new DropTarget(getControl(), operations);

Transfer[] types = new Transfer[] { FileTransfer.getInstance() };
target.setTransfer(types);

target.addDropListener(new DropTargetListener() {
public void dragEnter(DropTargetEvent event) {
if(event.detail == DND.DROP_DEFAULT) {
if((event.operations & DND.DROP_COPY) != 0) {
event.detail = DND.DROP_COPY;
}
else {
event.detail = DND.DROP_NONE;
}
}
}

public void dragLeave(DropTargetEvent event) {
}

public void dragOperationChanged(DropTargetEvent event) {
if(event.detail == DND.DROP_DEFAULT) {
if((event.operations & DND.DROP_COPY) != 0) {
event.detail = DND.DROP_COPY;
}

else {
event.detail = DND.DROP_NONE;
}

}
}

public void dragOver(DropTargetEvent event) {
event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL |
DND.FEEDBACK_EXPAND;
}

public void drop(DropTargetEvent event) {
if(FileTransfer.getInstance().isSupportedType(event.currentD ataType)){
String[] files = (String[])event.data;
handleFilesDropped(files, event.item);
}

}

public void dropAccept(DropTargetEvent event) {
}

});








"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:d1ukp9$frl$1@news.eclipse.org...
> Are you registering for the type FileTransfer? There does not seem to be
> a standard format used by the various file manipulation tools on Linux. I
> have implemented support for text/uri-list but it appears that many
> applications have their own formats such as x-special/gnome-copied-files.
> I need to investigate more of these formats and see if I can support them.
> You can run the ClipboardExample (org.eclipse.swt.examples) and it will
> show you a list of formats that have been placed on the Clipboard when you
> copy a file from one of the external tools. Drag and Drop generally
> supports the same formats as the clipboard. Enter a bug report against
> Platform SWT if there is a specific format you want to see supported.
> (e.g. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86569)
>
> "Phillip Beauvoir" <p.beauvoir@bolton.ac.uk> wrote in message
> news:d1ugh1$9kr$1@news.eclipse.org...
>> Hi,
>>
>> drag and dropping native files from Windows desktop to my Eclipse RCP
>> application works just fine on Windows, but not on my version of Linux
>> (SimplyMEPIS 3.3 using Konqueror and KDE) - I get no drag/drop events at
>> all dragging files from Konqueror to my RCP app. Are there issues?
>>
>> Phil
>>
>>
>
>
Re: Drag and Drop files to RCP app not working on Linux? [message #452828 is a reply to message #452758] Thu, 24 March 2005 16:19 Go to previous message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
I found the problem. I also needed to register the DND.DROP_MOVE operation
as well as DND.DROP_COPY. So, my mistake.

Thanks very much for taking the time to reply, Veronika. Playing with the
ClipboardExample showed me that something was
wrong in my code, not Eclipse's.

Phil


"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:d1ukp9$frl$1@news.eclipse.org...
> Are you registering for the type FileTransfer? There does not seem to be
> a standard format used by the various file manipulation tools on Linux. I
> have implemented support for text/uri-list but it appears that many
> applications have their own formats such as x-special/gnome-copied-files.
> I need to investigate more of these formats and see if I can support them.
> You can run the ClipboardExample (org.eclipse.swt.examples) and it will
> show you a list of formats that have been placed on the Clipboard when you
> copy a file from one of the external tools. Drag and Drop generally
> supports the same formats as the clipboard. Enter a bug report against
> Platform SWT if there is a specific format you want to see supported.
> (e.g. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86569)
>
> "Phillip Beauvoir" <p.beauvoir@bolton.ac.uk> wrote in message
> news:d1ugh1$9kr$1@news.eclipse.org...
>> Hi,
>>
>> drag and dropping native files from Windows desktop to my Eclipse RCP
>> application works just fine on Windows, but not on my version of Linux
>> (SimplyMEPIS 3.3 using Konqueror and KDE) - I get no drag/drop events at
>> all dragging files from Konqueror to my RCP app. Are there issues?
>>
>> Phil
>>
>>
>
>
Previous Topic:Display.asyncExec and UI queue
Next Topic:SWT of plugin.xml
Goto Forum:
  


Current Time: Fri Apr 19 11:46:30 GMT 2024

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

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

Back to the top