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 2337

Summary: Make text selection draggable in the Editor.
Product: editor Reporter: Jesse Glick <jglick>
Component: -- Other --Assignee: Martin Roskanin <mroskanin>
Status: RESOLVED FIXED    
Severity: enhancement CC: bobtarling, rbock, ulfzibis
Priority: P2    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 31362, 32942, 35023, 46020    
Bug Blocks:    

Description Jan Lahoda 2001-01-24 15:35:59 UTC
Only changed version to Development.
Comment 1 Jan Chalupa 2001-05-05 21:53:22 UTC
Target milestone -> 3.3
Comment 2 David Konecny 2001-05-22 15:33:59 UTC
Re-assigning issues back to the bugs@editor.netbeans.org
Comment 3 David Konecny 2001-06-18 13:45:00 UTC
Changing the state of the issue to ASSIGNED, because it was covered in 
Requirements document at http://editor.netbeans.org/doc/Requirements.html
Comment 4 Jan Chalupa 2001-11-27 12:27:39 UTC
Target milestone -> 3.3.1.
Comment 5 Marek Grummich 2002-07-22 12:21:07 UTC
Set target milestone to TBD
Comment 6 Marek Grummich 2002-07-22 12:26:33 UTC
Set target milestone to TBD
Comment 7 Roman Strobl 2004-12-07 10:48:26 UTC
*** Issue 31362 has been marked as a duplicate of this issue. ***
Comment 8 Roman Strobl 2004-12-07 10:49:33 UTC
Increasing priority to P3, I've seen several more reports requesting
this feature. 
Comment 9 Roman Strobl 2004-12-07 10:50:42 UTC
*** Issue 32942 has been marked as a duplicate of this issue. ***
Comment 10 Roman Strobl 2004-12-07 10:51:41 UTC
*** Issue 46020 has been marked as a duplicate of this issue. ***
Comment 11 Roman Strobl 2004-12-07 10:52:43 UTC
See the other issues which I marked as a duplicate of this one, there
are interesting ideas on how to implement it. 
Comment 12 Roman Strobl 2004-12-07 14:52:13 UTC
Changing subcomponent to clipboard.
Comment 13 Petr Nejedly 2004-12-08 10:37:21 UTC
*** Issue 35023 has been marked as a duplicate of this issue. ***
Comment 14 bobtarling 2004-12-08 10:51:07 UTC
Here are my notes from dup issue 32942 -

These are features on many M$ editors that I often find 
useful and are likely to be familiar to many developers.

1. Mark an area of text then the user can click on and 
drag that text to another part of the document.
2. Holding the ctrl key down at the same time as the above 
drags a copy rather than the original.
3. Holding the alt key down while marking text marks a 
column block of text which can be cut and pasted or 
drag 'n' dropped using (1) and (2) above.
Comment 15 Martin Roskanin 2005-04-06 09:11:20 UTC
*** Issue 57495 has been marked as a duplicate of this issue. ***
Comment 16 ulfzibis 2005-04-08 21:33:07 UTC
I propose a moving (as it is implemented in MS Word or in this browser text area
for example) by pressing the left mouse button in the marked text area, holding
it, moving the mouse to the target text position and there releasing the left
mouse button. Copying should be done by simultaneously pressing the Ctrl-key.
Additionaly copying should be done by simultaneously pressing the right
mouse button.
Also replacing a text area with the selected text portion should be possible by
additionaly pressing the right mouse button at target text position and then
marking the to-be-replaced text area by moving the cursor over it. Moving the
selected text portion instead of coping it should then be provided by letting
loose the left mouse button while holding the right mouse button. A tool tip
should indicate the actual replace/move/copy mode.
Comment 17 Roman Strobl 2005-04-20 15:48:51 UTC
*** Issue 15205 has been marked as a duplicate of this issue. ***
Comment 18 Roman Strobl 2005-04-20 15:49:20 UTC
Increasing priority because of votes in the duplicate issue.
Comment 19 ulfzibis 2005-04-27 16:56:11 UTC
** Correction: **

** trend-setting feature **

.. I also propose that *replacing* a text area with the just before selected
text portion should be possible by additionally pressing the right mouse button
at the target text position and then marking the to-be-replaced text area by
moving the cursor over it. Call it *"mark-for-replace"* feature. Copying the
selected text portion instead of moving it then should be provided by letting
loose the left mouse button ("letting loose" the original) while holding the
right mouse button.
In case of copying by holding both mouse buttons letting loose the left mouse
button should start marking the replace area at the actual mouse position, and
pressing the right mouse button ("catching" the original) again should provide
moving.

The replace-action is always actuated by releasing the right mouse button.

A *tool tip* should indicate the actual move/copy/replace mode. For clarity the
additional hint for replacing could be textual: 'replace', instead of symbolic,
but I think highligthing the to-be-replaced text area suffices.

See also: http://forums.java.net/jive/thread.jspa?messageID=14227&#14227
Comment 20 Miloslav Metelka 2005-05-04 09:48:26 UTC
I agree to implement the simple version of dragging with possible Ctrl key used
to copy the text.

To ulfzibis: the feature from your last comment seems rather complicated to me
personally. I'm adding rbock to cc to resolve whether this is desirable to be
implemented or not.
Comment 21 Miloslav Metelka 2005-05-06 13:49:26 UTC
I propose that the scope of this enhancement should be to implement simple text
dragging with optional Ctrl modifier key used for copying of the text (instead
of moving). Additional extra features can be added later.
 We need to be careful regarding present hyperlinking functionality which also
uses Ctrl key to highlight the identifiers and goto their declaration when
clicked. The only difference will be drag versus click. Should be feasible.
Comment 22 ulfzibis 2005-05-06 18:35:33 UTC
I like it to see the drag 'n drop in 4.2. :-)

In regarding to present hyperlinking functionality it could be helpful, to
addionally have the copy-mode by simultaneously pressing the right mouse button
when dragging. Then it's not obligatory to use the ctrl-key for copying, and it
superseds keyboard-usage by the second hand. In my opinion this would be very
comfortable.
Comment 23 Martin Roskanin 2005-06-17 13:32:36 UTC
fixed in [maintrunk]

Checking in org/netbeans/modules/editor/options/AllOptionsFolder.java;
/cvs/editor/src/org/netbeans/modules/editor/options/AllOptionsFolder.java,v  <--
 AllOptionsFolder.java
new revision: 1.33; previous revision: 1.32
done
Checking in org/netbeans/modules/editor/options/AllOptionsFolderBeanInfo.java;
/cvs/editor/src/org/netbeans/modules/editor/options/AllOptionsFolderBeanInfo.java,v
 <--  AllOptionsFolderBeanInfo.java
new revision: 1.6; previous revision: 1.5
done
Checking in org/netbeans/modules/editor/options/BaseOptions.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v  <-- 
BaseOptions.java
new revision: 1.103; previous revision: 1.102
done
Checking in org/netbeans/modules/editor/options/BaseOptionsBeanInfo.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptionsBeanInfo.java,v 
<--  BaseOptionsBeanInfo.java
new revision: 1.33; previous revision: 1.32
done
Checking in org/netbeans/modules/editor/options/Bundle.properties;
/cvs/editor/src/org/netbeans/modules/editor/options/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.81; previous revision: 1.80
done
Checking in org/netbeans/editor/BaseCaret.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseCaret.java,v  <--  BaseCaret.java
new revision: 1.114; previous revision: 1.113
done
Checking in org/netbeans/editor/BaseSettingsInitializer.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseSettingsInitializer.java,v  <-- 
BaseSettingsInitializer.java
new revision: 1.27; previous revision: 1.26
done
Checking in org/netbeans/editor/EditorUI.java;
/cvs/editor/libsrc/org/netbeans/editor/EditorUI.java,v  <--  EditorUI.java
new revision: 1.74; previous revision: 1.73
done
Checking in org/netbeans/editor/SettingsDefaults.java;
/cvs/editor/libsrc/org/netbeans/editor/SettingsDefaults.java,v  <-- 
SettingsDefaults.java
new revision: 1.56; previous revision: 1.55
done
Checking in org/netbeans/editor/SettingsNames.java;
/cvs/editor/libsrc/org/netbeans/editor/SettingsNames.java,v  <--  SettingsNames.java
new revision: 1.20; previous revision: 1.19
done
Comment 24 ulfzibis 2005-06-17 20:27:54 UTC
Is there any build, which you estimate nearly stable like 4.1 ? I like to test
this feature.
Comment 25 Martin Roskanin 2005-06-20 12:53:48 UTC
You can use daily builds since the date the issue was commited or you can wait for
Q-build:
http://qa.netbeans.org/q-builds/index.html
Comment 26 ulfzibis 2005-06-24 17:56:32 UTC
I downloaded and installed the recent Q-build.

I can't experience any drag 'n drop in the editor.
Comment 27 Martin Matula 2005-06-24 20:26:55 UTC
The current q-build is too old - this change was integrated on June 20, however
the latest q-build was branched on June 14. you have to wait for the next
q-build or use the development build.
Comment 28 Martin Matula 2005-06-24 20:32:13 UTC
Correction - this was fixed on June 17 (still late for the current q-build, thus
you have to wait for the next one).
Comment 29 ulfzibis 2005-07-06 12:05:37 UTC
Is it possible to have this editor enhencement as .nbm for NB 4.1 via the
development update center ?
Comment 30 ulfzibis 2005-07-14 22:59:01 UTC
I have tested this new feature. It works fine, but there is a little defect:

When an area is marked, and the left mouse button is hit inside the marked area
whithout moving it, the marking remains. This behavior is differing from normal
behavior of Microsoft editors, where the marking disappears after clicking.
Imagine, the whole text is marked, then there is no chance to unmark it.
Comment 31 Martin Roskanin 2005-07-15 08:37:17 UTC
Yes, this problem was already fixed, please see the issue #60547
If you found this problem in the latest dev build, please reopen the issue.
Thanks for testing.
Comment 32 ulfzibis 2005-07-15 09:46:55 UTC
Can't test the the fruit of Issue 60547 because of Issue 61012.

Also please answer my last before question, how to update the actual editor of
4.1 with this beta update.
Comment 33 Martin Roskanin 2006-01-10 12:53:39 UTC
feature was implemented
Comment 34 Vitezslav Stejskal 2007-11-05 13:31:34 UTC
Moving to the 'other' subcomponent.
Comment 35 ulfzibis 2010-01-26 05:22:23 UTC
I have added another, better worded description here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6254533