Closed GoogleCodeExporter closed 9 years ago
The tree is explicitly *not* exposed in order to hide the complexities of
implementation. What methods on JTree
do you need?
Feel free to email me you other changes and I can look at incorporating them
back into the code base.
Original comment by kenneth....@gmail.com
on 16 Jan 2009 at 11:50
Well, for now, its this:
// get internal tree
JTree tree = sourceList.getTree();
tree.setDragEnabled(true);
tree.setDropMode(DropMode.ON_OR_INSERT);
tree.setTransferHandler(new JakeSourceListTransferHandler());
Seems Drag&Drop won't be that easy! Saw the nice blue borders Apple's SourceList
draws when you drop something in? That would be awsome... at least some sort of
selection - using the new DropMode.ON_OR_INSERT of Java6 does not change your
selection instantly while dropping. Which is good. Bad is, on SourceList it
does not
show any drop feedback.
But: the position markers between the items id drawn.
Original comment by studp...@gmail.com
on 16 Jan 2009 at 12:03
I'd rather have SourceList support D&D than to expose it's JTree so that
developers can implement it themselves.
What methods would you need on SourceList to support this?
Original comment by kenneth....@gmail.com
on 16 Jan 2009 at 12:10
Ok, i'll be fine with that!
Those three functions passed-through are a good start.
Don't think there is a need for more.
For further infos about d&d, i recommend
http://weblogs.java.net/blog/shan_man/archive/2006/02/choosing_the_dr.html.
I could write those proxy-methods for you, need them anyway. Just tell me.
Original comment by studp...@gmail.com
on 16 Jan 2009 at 12:24
I added setTransferHandler to SourceList which automatically setDragEnabled
true if the given handler is not null,
and false otherwise. I'm not familiar with the setDropMode method, which isn't
available in Java 1.5.
Let me know if this change meets your need, and I'll close this issue.
Original comment by kenneth....@gmail.com
on 30 Jan 2009 at 12:10
Hi Ken,
setDropMode is a new Handler for the MUCH(!) improved d&d in java 1.6.
You need that e.g. when you want to keep tree selection and use dd, detect
inserts between nodes, and so on.
Hmmm. Semms like trouble, as this isn't available in 1.5, so proxying it is not
possible.
(Well, via reflection, but that's not a good idea)
I don't know what's best practice there.
Currently we use your framework and fork it a little, to get access to the
inner components...
(as our project is 1.6 only; and yes, we're going open source, so you can see
the changes)
So, for now, I've no problem closing the issue.
Original comment by studp...@gmail.com
on 30 Jan 2009 at 12:36
Original comment by kenneth....@gmail.com
on 30 Jan 2009 at 12:57
Original issue reported on code.google.com by
studp...@gmail.com
on 16 Jan 2009 at 1:26