Skip to main content


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] Sat, 18 December 2010 03:20 Go to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
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 13:33 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior 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 14:43 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
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 14: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: Thu Apr 25 23:54:05 GMT 2024

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

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

Back to the top