Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 45831 - [dnd] Used drag/drop for views to rearrange contents of file.
Summary: [dnd] Used drag/drop for views to rearrange contents of file.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Benno Baumgartner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 17296 34071 72807 128782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-30 16:40 EST by Jamie Bisotti CLA
Modified: 2007-08-07 08:46 EDT (History)
7 users (show)

See Also:


Attachments
fix (18.69 KB, patch)
2007-07-30 13:36 EDT, Benno Baumgartner CLA
no flags Details | Diff
fix (53.85 KB, patch)
2007-07-30 13:41 EDT, Benno Baumgartner CLA
no flags Details | Diff
fix (57.33 KB, patch)
2007-07-31 03:35 EDT, Benno Baumgartner CLA
no flags Details | Diff
enable for members view (4.02 KB, patch)
2007-08-02 08:50 EDT, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jamie Bisotti CLA 2003-10-30 16:40:54 EST
I would like to be able to drag/drop a method in Outline (Hierarch, Package
Exploerer, etc...) and have the corresponding code moved in the file.  For
example, I would like to be able to drag/drop and group all my public methods
together.  It wouldn't have to be limited to only methods; inner classes,
fields, etc... would also be useful.
Comment 1 Dirk Baeumer CLA 2003-10-31 04:29:48 EST
This is on our feature list as well ;-)).
Comment 2 Dirk Baeumer CLA 2006-04-05 14:16:41 EDT
Moving back to inbox.
Comment 3 Jamie Bisotti CLA 2007-05-17 10:34:26 EDT
Is this going to be addressed in 3.3?
Comment 4 Martin Aeschlimann CLA 2007-05-18 05:59:09 EDT
DND to rearange files is already there, but it doesn't use good visual feedback (it doesn't use the horizontal line).
It also asks to save the file.

Will look at in 3.4
Comment 5 Benno Baumgartner CLA 2007-07-18 04:44:29 EDT
*** Bug 34071 has been marked as a duplicate of this bug. ***
Comment 6 Benno Baumgartner CLA 2007-07-19 03:57:14 EDT
*** Bug 72807 has been marked as a duplicate of this bug. ***
Comment 7 Benno Baumgartner CLA 2007-07-19 04:00:17 EDT
*** Bug 128782 has been marked as a duplicate of this bug. ***
Comment 8 Benno Baumgartner CLA 2007-07-19 04:01:18 EDT
Following must be done:
1. Enable the line feedback (very easy)
2. Do not ask to save the file, all refactorings should work with dirty editors, it does not because of MoveResourceChange and CopyResourceChange
3. The reorg refactoring must know where to add the code, above or below the target.
4. The reorg refactoring must insert the code above and below the target once it knows that, which is the part which requires the most work to be done.
Comment 9 Benno Baumgartner CLA 2007-07-19 04:11:29 EDT
But, there is one big issue with this, the user has no clue what happens when the view is sorted i.e. where will it be inserted?

There are two options then:
a) insert the member above/below the target
b) insert the member such that it appears above/below the target in the sorted view

a) has the problem, that when the member is dropped it will not appear where it was dropped
b) is difficult to implement, I must somehow find out where to insert the member, I guess this requires to know the view and its sorter.

I think from a user point of view b) would be the right thing to do, what you think?
Comment 10 Markus Keller CLA 2007-07-19 05:07:47 EDT
> b) insert the member such that it appears above/below the target in the sorted
> view

This could only be achieved by renaming an item, which is certainly not an option.

When a view is sorted, we should not offer any position-related drop positions. They make little sense, and the user should not be lead into believing that he really can rearrange items in sorted views. Dropping onto an item should still insert the item at the default position inside the drop target (like in the unsorted case).

An alternative could be to allow position-based dropping and to show a dialog in this case, which asks whether sorting should be turned off. But I think disabling the functionality upfront is the better approach.
Comment 11 Benno Baumgartner CLA 2007-07-19 05:22:22 EDT
Yes, stupid me, we have to go with a) of course.

The user can rearrange the code even if the view is sorted, it makes sens to be able to select if a member is inserted before or after the drop target. Only the feedback would be a bit confusing. I think disabling would lead to bug reports like 'I can't DnD no more in the outline view' also the PE is always sorted.
Comment 12 Benno Baumgartner CLA 2007-07-19 09:07:45 EDT
Yes, you're right Markus, for the user a drop target between two items can be considered either below the top item or above the bottom item. The UI does not give the required feedback. I think best thing to do is:

- Sorted view
   Do not show above/below feedback, only allow to drop onto if this results in a copy/move into (i.e. drop field on type ok, but not drop field on field)
- Unsorted view (Outline and Members view if not sorted)
   Do as requested in this bug, that is, show above/below feedback and add code above/below, only allow to drop onto if this result in a copy/move into

We tried in firefoxs bookmark view, and it is very confusing if you can change the order of items of a model in a sorted view.
Comment 13 Benno Baumgartner CLA 2007-07-19 10:53:05 EDT
*** Bug 17296 has been marked as a duplicate of this bug. ***
Comment 14 Benno Baumgartner CLA 2007-07-30 13:36:18 EDT
Created attachment 74952 [details]
fix
Comment 15 Benno Baumgartner CLA 2007-07-30 13:41:39 EDT
Created attachment 74953 [details]
fix
Comment 16 Benno Baumgartner CLA 2007-07-31 03:35:02 EDT
Created attachment 75004 [details]
fix

Released for todays I-Build. Enabled it only for the Outline view. Give it a try...
Comment 17 Dani Megert CLA 2007-07-31 11:10:33 EDT
Works quite good. Having selection feedback when dropping isn't possible is a bit confusing. Filed bug 198408 to track this.
Comment 18 Benno Baumgartner CLA 2007-08-02 08:50:44 EDT
Created attachment 75214 [details]
enable for members view
Comment 19 Benno Baumgartner CLA 2007-08-02 08:53:08 EDT
fixed > I20070731-0800
Comment 20 Dani Megert CLA 2007-08-07 08:46:51 EDT
Verified in I20070807-0010.