Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to control DND enablement with DropTarget and Graphicalviewer
how to control DND enablement with DropTarget and Graphicalviewer [message #245964] Tue, 28 October 2008 06:20 Go to next message
Philipp Simon is currently offline Philipp SimonFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

i am not sure if this is an swt/eclipse.ui related problem but i feel like
this is the right place to ask.

The goal is to allow dragging and dropping items from views like the
navigator to our gef editor. We basically achieved that by creating a
droptarget ( with a localselectiontransfer set) on the graphicalviewer and
adding a droptargetlistener to it. The problem we hit is that this
basically allows drag and drops of all kinds of objects to the editor (
seems like the localselectiontransfer does that). By allowing i mean that
the cursor icon turns into the drop allowed state ( for e.g. win platforms
this results in a circle with a 45 degree line inside icon disappearing).
But what we want is something like: check the object type of the selection
from the localselectiontransfer and allow/deny dnd for specific types of
objects ( like folder no file yes). It seems to me that there are two ways
to do that. Either create a custom transfer object to specify allowances
for the drop target or go introduce some sort of deny request that
imitates the denial cursor. Approach one does not look recommended and
approach two does not look too appealing either ( having to check for the
correct platform specific appearence for show/erasetargetfeedback).
I somehow can not get rid of the feeling that there must be a third way we
are missing but i fail to find help resources containing the right hints.
Could someone please help us out?

Thanks,
Philipp
Re: how to control DND enablement with DropTarget and Graphicalviewer [message #245977 is a reply to message #245964] Wed, 29 October 2008 09:36 Go to previous message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

well your first approach is all right... i dont find any problem in that... i have also implemented something similar by extending TransferDragSourceListener, where i can also allow which object can be dragged and which cannot..,
Previous Topic:Palette keyboard usage
Next Topic:CreationTool not firing after change of Perspective
Goto Forum:
  


Current Time: Fri Apr 26 19:39:50 GMT 2024

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

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

Back to the top