This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37279 - DnD: Drop destination ignored
Summary: DnD: Drop destination ignored
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-17 15:06 UTC by pgriebel
Modified: 2008-12-22 20:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
binary patch applicable in lib/patches (22.52 KB, application/octet-stream)
2003-11-19 15:08 UTC, Jiri Rechtacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pgriebel 2003-11-17 15:06:38 UTC
Here is a problem with drag'n'drop.

I have two different parent nodes. The destination
parent node containts Index Support (has a Support
cookie attached.) So reordering of the child nodes
works flawlessly.

Now I'm trying to drag a node which is a child of
first parent node into the second parent node
_between two nodes_. The problem is that now the
node is not placed at the right position between
these two nodes but at the end of the nodes.

I think I found the reason: The class
TreeViewDropSupport implements the drop sequence.
It includes some code to perform the reordering.
But the reordering of nodes in this case operates
upon the nodes names.

So the problem is: The dropped node has to get the
same name as the dragged node. Otherwise the code
in findDropedNodes() can't find the node to be
reordered. But I can't give the dropped node the
same name as the dragged node. Because if I did
this I would end up with nodes with the same name
when using the copying drag'n'drop mode (using the
control key) mutiple times. 

Jiri answered already:

The heart of this problem is a weakness in finding
node in explorer, it's based on name of node. The
several issues about it was filed (see issue
18780, issue 22030). Code wants select node with a
given name but the name is being changed to avoid
duplicate names on one folder (i.e. Foo changed to
Foo_1). The code finds the node Foo instead of
Foo_1, but it's wrong.
Comment 1 Jiri Rechtacek 2003-11-18 16:10:28 UTC
Peer, the findDropedNodes() asks the parent node for index on which
droped node is placed. See Children's javadoc of findChild(String
name), it proposes implement more advanced way to find a child. It's a
one of places which can improve DnD behavior. You could extend you
parent node children and provide better findChild() method. On the
other hand, a name is lack of information to return a right node.
I try use a util method for finding child, attach a jar patch to this
issue. Could you ensure if it would fix this issue? Thanks
Comment 2 pgriebel 2003-11-19 07:14:42 UTC
Jiri, I know the findChild() method. But as you stated the name is not
enough to identify destination.
But I would be very glad to try your patch and post the results.
Comment 3 Jiri Rechtacek 2003-11-19 15:08:12 UTC
Created attachment 12219 [details]
binary patch applicable in lib/patches
Comment 4 Jiri Rechtacek 2003-11-19 15:11:42 UTC
I attached the patch, it finds pasted nodes in folder and trying to
select it. It should work better then now. Please, test it. Thanks
Comment 5 pgriebel 2003-11-20 08:19:19 UTC
Congratulations! The pasted nodes are now identified correctly. The
pasted nodes are selected (mostly). The dropped nodes are not selected
when I perform a drag to a different explorer. But nonetheless -thanks!
Comment 6 Jiri Rechtacek 2003-11-20 22:35:48 UTC
Fine, I did more work on selecting nodes which are moved from one
folder to other on. It worked more better. It's fixed in maintrunk.
Comment 7 Marian Mirilovic 2005-07-13 13:23:19 UTC
closed