Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Can I change the cursor during DnD?(How can I show different cursors during DnD, not just YES/NO)
Can I change the cursor during DnD? [message #645571] Fri, 17 December 2010 22:20 Go to next message
Felix L J Mayer is currently offline Felix L J Mayer
Messages: 202
Registered: July 2009
Senior Member
I am dragging a Java IType from the Package Explorer to onto my diagram. Depending on the EditPart underneath, I would like show different cursors if dropping is possible. I have looked into various places that deal with cursors (AbstractTool, Control, EditPartViewer), but none of the cursor-related methods are executed when a drag is in progress. Is there any way to change the cursor?
Re: Can I change the cursor during DnD? [message #645594 is a reply to message #645571] Sat, 18 December 2010 08:33 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander Nyssen
Messages: 40
Registered: July 2009
Location: L√ľnen
Member
Take a look at DragEditsPartTracker and its superclass SelectEditPartsTracker. They provide a means to "calculate" cursors during a drag operation.
Re: Can I change the cursor during DnD? [message #645598 is a reply to message #645594] Sat, 18 December 2010 09:43 Go to previous message
Felix L J Mayer is currently offline Felix L J Mayer
Messages: 202
Registered: July 2009
Senior Member
SelectEditPartsTracker is a subclass of AbstractTool, which I already investigated. I put breakpoints into the calculateCursor() methods, but they are not executed when I drag something from the Package Explorer. The only thing I see executed is EditPolicy.getCommand(), and the cursor does change when null is returned. However, I failed to find any code that actually changes the cursor afterwards. I couldn't even find a reference to org.eclipse.swt.graphics.Cursor in the org.eclipse.swt.dnd package.

[Updated on: Sat, 18 December 2010 09:57]

Report message to a moderator

Previous Topic:Disable selection of figures in GEF
Next Topic:Drag & drop in Outline view is completely broken
Goto Forum:
  


Current Time: Fri Aug 01 20:31:25 EDT 2014

Powered by FUDForum. Page generated in 0.04276 seconds