Disable GEF TreeViewer DND Feedback [message #240124] |
Tue, 04 December 2007 15:18 |
Eclipse User |
|
|
|
Originally posted by: schiermike.xxx.at
Hello,
in my program, I use a calendar in my editor and in a separate view a tree
containing several items each having a label and an icon.
Drag&Drop from the view to the editor works perfectly and when dragging an
item, a default feedback is shown.
My problem is: I want to use a customized feedback for the drag-operation
(showing the duration of the item graphically which i want to add to the
calendar). This also worked by drawing on the SCALED_FEEDBACK_LAYER in a
function which is called by updateTargetEditPart() in my
DropTargetListener.
What is still there is the default-feedback which I mentioned previously.
It causes my feedback to flicker and some "dirt" remains on the
FEEDBACK-LAYER from previous feedback-draw-calls which can only be avoided
when i refresh the whole FEEDBACK-LAYER - but the default-Feedback is
still there :-(
Is there a way to disable this default feedback? I tried several things
including playing around with DND.FEEDBACK_NONE in the TreeViewers SWT
Tree component but nothing seems to work...
thx for your help!
|
|
|
Re: Disable GEF TreeViewer DND Feedback [message #240171 is a reply to message #240124] |
Wed, 05 December 2007 20:17 |
Eclipse User |
|
|
|
Originally posted by: mgauthier.trisotech.com
Hi,
All classes related to the DND in the TreeViewer have a default visibility
which makes them impossible to modify. They are set in the constructor of
the TreeViewer.
addDragSourceListener(new TreeViewerTransferDragListener(this));
addDropTargetListener(new TreeViewerTransferDropListener(this));
There's a bugzilla (139666) about the limitation of the DND in GEF
TreeViewer. I think a solution for you, not the ideal one though, could be
to extend TreeViewer and recreate the classes required for the DND (which
could be inspired by the actuals classes) and set them instead of the
default one in the constructor so you can program them to do whatever you
want.
You can also take a look at TreeContainerEditPolicy, where there's private
method to show feedback. I think it is tightly couple with the actual
widget, but maybe you could change the cursor.
Hope those hints helped you!
Mélanie
|
|
|
|
Powered by
FUDForum. Page generated in 0.03174 seconds