Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 29031 - [TTV] Add Drag & Drop support for the treetable
[TTV] Add Drag & Drop support for the treetable
Status: RESOLVED WONTFIX
Product: platform
Classification: Unclassified
Component: Outline&TreeTable
3.x
All All
: P2 (vote)
: TBD
Assigned To: Stanislav Aubrecht
issues@platform
: UI
Depends on:
Blocks: 70468 33281 80162
  Show dependency treegraph
 
Reported: 2002-11-26 21:59 UTC by Torbjorn Norbye
Modified: 2008-12-22 09:50 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
a patch for testing not for integration to trunk (2.75 KB, patch)
2002-11-29 18:01 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2002-11-26 21:59:41 UTC
The TreeTableView does not have drag & drop
support like the other explorers. That seems
inconsistent and unfortunate.

If you don't have the resources to do it, I would
appreciate it if you wrote down what you know
about it (e.g. the steps involved, possibly an
estimate of how much work it would be) in case I
have a chance to work on it myself over the holidays.

TreeTableView.java:
    /* DnD is not implemented for treeTable.
     */
    public void setDragSource (boolean state) {
    }

    /* DnD is not implemented for treeTable.
     */
    public void setDropTarget (boolean state) {
    }
Comment 1 Jiri Rechtacek 2002-11-28 18:31:55 UTC
I investigated it and i seemed as hard work. I didn't succeed to a
attach gesture listener. Maybe the mouse listener eat mouse events.
I will try it tomorrow again with a fresh mind :)
In general: the DnD in the tree views is based on Cut&Paste actions. A
dragSource and dropTarget is get from node.clipboardCut(),
node.getPasteTypes. Other means of DnD sources isn't implemented yet.
Is it sufficient for your purpose? For which sort of actions it should
be used?
Comment 2 Torbjorn Norbye 2002-11-28 21:38:22 UTC
This is intended for reordering the task/suggestions list. If I want
to make one task a subtask of another, or make one task appear higher
in the list, I want to be able to drag it just like I can move files
in the explorer.

Thanks for working on it! I really appreciate it!
Comment 3 Jiri Rechtacek 2002-11-29 18:00:08 UTC
I didn't found any reason why it didn't work for me. I completely
ended at a exception from native peer on linux with jdk1.4.1fcs (on
windows it operates a little bit but I haven't win on my machine to
play with). See at exception, maybe it helps you. I attach a hot patch
which enables DnD in TTW, try it on your solaris if can. I am sorry I
now couldn't help more I haven't any idea. Lots of luck to passed it.
I'm ready to help when you'll solve the described problem.

startDrag with:
    cursor: sun.awt.motif.X11CustomCursor[ACTION_MOVE]
    image: BufferedImage@666c7a: type = 0 DirectColorModel:
rmask=ff0000 gmask=ff00 bmask=ff amask=1000000
IntegerInterleavedRaster: width = 32 height = 32 #Bands = 4 xOff = 0
yOff = 0 dataOffset[0] 0
    point: java.awt.Point[x=16,y=16]
    transferable: org.openide.util.datatransfer.ExTransferable@113eb9c
    listener: org.openide.explorer.view.TreeViewDragSupport@d16d11
    event:
java.awt.dnd.DragGestureEvent[source=sun.awt.motif.MMouseDragGestureRecognizer@14f83d1]
-- done
INFORMATIONAL *********** Exception occurred ************ at Fri Nov
29 18:29:59 CET 2002
java.awt.dnd.InvalidDnDOperationException: failed to create native
peer: java.lang.NullPointerException: null native data for trigger event
	at
sun.awt.motif.MDragSourceContextPeer.startDrag(MDragSourceContextPeer.java:71)
	at
sun.awt.dnd.SunDragSourceContextPeer.startDrag(SunDragSourceContextPeer.java:106)
	at java.awt.dnd.DragSource.startDrag(DragSource.java:305)
	at java.awt.dnd.DragSource.startDrag(DragSource.java:375)
	at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:245)
[catch] at
org.openide.explorer.view.ExplorerDragSupport.dragGestureRecognized(ExplorerDragSupport.java:125)
Comment 4 Jiri Rechtacek 2002-11-29 18:01:43 UTC
Created attachment 8115 [details]
a patch for testing not for integration to trunk
Comment 5 Torbjorn Norbye 2002-11-30 00:35:07 UTC
On Solaris I get the same exceptions that you observed. I tried with
both jdk1.4.1_01 and jdk1.4.2-b08 - same problem.  I also ran on
Windows, and drag & drop -sort- of worked; no exceptions, and the drag
source node is deleted before I release the mouse button.

I'm not sure if this is a bug in drag & drop, or more likely that
we'll need to do something extra for TreeTables, since they're a
composite component of a JTree and a JTable; perhaps this composition
is tricking the drag & drop code.  I looked at the source code for the
last version of the TreeTable component in the Swing Connection:

http://java.sun.com/products/jfc/tsc/articles/treetable2/

but there's no references to "drag" or "drop" in the source code. I
unfortunately don't understand enough about drag & drop yet to make
sense of this, so I'll have to get educated on it before I can make
any progress with this.
Comment 6 Torbjorn Norbye 2002-11-30 00:39:59 UTC
Small correction - I noticed that on Solaris with 1.4.2-b08, and in
SDI mode (this might have been the case in the other configurations
too and I just didn't notice it) the source node is ALSO deleted, just
like on Windows.  So the only difference is that on Windows, there's
no exception dump, and I get a little "drop rectangle" appearing which
I don't see on Solaris.
Comment 7 nicolas 2004-01-13 16:23:09 UTC
Hi,

Just a little comment to let people know I'm very interested in this 
feature. If that can help the person working on it, I'm 100% 
supporting you :)

Yours truly,

Nicolas.
Comment 8 Martin Brehovsky 2004-10-08 11:22:08 UTC
Any progress with this issue?
Comment 9 _ tboudreau 2004-10-08 14:47:47 UTC
No plans to integrate it into the trunk for 4.0 - given the fragility of TTV, I'm not much in 
favor of doing anything destabilizing to it at this point (post beta 2).  Could easily be 
supported after the TTV rewrite.  AFAIK, DND in a TTV is not a requirement for anything in 
NB 4.0.  Sorry to be contrarian, but TTV is rather like a very tall castle made of dominoes - 
a tiny push and the whole thing collapses.

Jirka, you have a better sense than I do of how stable this is.  Comments?
Comment 10 Martin Brehovsky 2005-07-22 13:41:16 UTC
Anything new on this issue? I would like to see this fixed for 4.2 ..
Comment 11 Unknown 2006-06-15 22:31:14 UTC
Posting a comment on this bug made by an user at bugs.sun.com:
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4785413
   Submitted On 14-JUN-2006
   Any resolution  on this? 
   It's been open for couple of years, w/o a good workaround...
Comment 12 Martin Entlicher 2007-05-21 17:06:37 UTC
*** Issue 44575 has been marked as a duplicate of this issue. ***
Comment 13 _ gtzabari 2007-05-21 18:22:39 UTC
Netbeans staff, can we set the target milestone of this issue to 6.0? It is a P2
RFE for years now and is now blocking a whole bunch of other P2 feature requests.
Comment 14 artibee 2008-03-26 14:06:20 UTC
Posting a comment on this bug made by an user at bugs.sun.com:
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4785413

   Submitted On 25-MAR-2008
   I was interested with this feature. Any progress ?
Comment 15 Stanislav Aubrecht 2008-03-26 14:54:45 UTC
new ttv with drag'n'drop support is planned for netbeans 7.0
Comment 16 Stanislav Aubrecht 2008-10-14 10:12:06 UTC
outline/outlineview in nb6.5 does support drag and drop - closing


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo