> The default JTextComponent framework does not allow it easily because the
> selection-mouselistener would colide with the move-mouselistener.

Wouldn't you just do something along the lines of:

DragSourceListener dragSourceListener = new DragSourceListener()
{...implement...}
DragGestureListener dragGestureListener = new DragGestureListener)
{...implement...}
DragSource dragSource = new DragSource();
DragGestureRecognizer dragGestureRecognizer =
dragSource.createDefaultDragGestureRecognizer(jTextComponent,
DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);

etc etc.

> > > But do you really *need* it? Jumping between
> > > the mouse and keyword significantly slows you down in writing code.
> >
> >I don't think this is true all the time. When I'm in the middle of writing
> >code, I ususually stick to the keyboard. But when I'm browsing around and
> >refactoring, I often the mouse because I can scroll around a file
> and browse
> >the project hierarchy more quickly with a mouse.
>
> That's why I already requested a possibility to move methods (or fields) up
> and down in a file using the Structure view. I think, that would be most
> easy and safe.

I agree DnD in the structure view would be great.  I'm usually a keyboard
cut 'n' paste person.. but, sometimes I don't want to learn a whole
new set of keyboard short cuts, and the mouse is quicker.   I'm not
talking about CTRL-[CVX]  I mean keyboard short cuts for selecting a word,
line, block - selecting till the next ',', ';', next occurence of 'this'
etc.  It's easier to use the mouse.

> >But anyway, since it's technically not possible, I guess none of
> this matters
> >:)
>
> If a feature would not be possible with Java or Swing, it would be possible
> for the IntelliJ guys. They always find a good solution. You only need to
> beg a lot ;-)
>
> Tom

Drag'n'Drop is definitely possible.  But, from Intellij's point of
view, if they're not planning till implement this till JDK1.4 comes out,
they may as well not bother at all.  With 1.4 they will simply call

jTextComponent.setDragEnabled(true);

Job done! (see
http://developer.java.sun.com/developer/technicalArticles/releases/data/)


For you guys wanting to know how to do Drag 'n' Drop now, I'd highly
recommend this free book chapter from O'Reilley:

http://www.oreilly.com/catalog/jswing/chapter/dnd.beta.pdf


ash



_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to