Bug 261373 - markup editor outline view to support drag and drop for reorganizing headings
Summary: markup editor outline view to support drag and drop for reorganizing headings
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.0.0   Edit
Assignee: David Green CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2009-01-16 12:10 EST by David Green CLA
Modified: 2011-01-06 10:01 EST (History)
0 users

See Also:


Attachments
work to date, incomplete (52.07 KB, patch)
2009-01-20 12:06 EST, David Green CLA
no flags Details | Diff
mylyn/context/zip (95.78 KB, application/octet-stream)
2009-01-20 12:06 EST, David Green CLA
no flags Details
working implementation with flaws (56.52 KB, patch)
2009-01-20 23:02 EST, David Green CLA
no flags Details | Diff
mylyn/context/zip (48.72 KB, application/octet-stream)
2009-01-20 23:02 EST, David Green CLA
no flags Details
mylyn/context/zip (39.82 KB, application/octet-stream)
2009-01-21 20:10 EST, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Green CLA 2009-01-16 12:10:54 EST
h1. Overview

with this enhancement the position of sections in a document can be moved by using drag and drop in the editor outline view.  Dragging an item will show it's new position with a line indicating the drop position.  When dropped, the heading and it's related content including sub-sections wil be moved in the document.

h1. Discussion

Whitespace handling may prove slightly difficult, since the editor has no knowledge of how headings work in any given markup language.  The offset of the heading in the document is where the markup starting it begins (usually the start of a line), and the end of a section is denoted by the next heading at the same level or the end of the document.  We have the following cases:

# moving a section to the start of the document
# moving a section to the end of the document
# moving a top-level section up/down within the document relative to its peers
# moving a sub-section up/down relative to its peers, or relative to sections of the same level elsewhere in the document
# moving a section to a different position in the document where there is a level mis-match

How whitespace is handled in these cases and how to determine the character offset should be planned carefully for each case.  With knowlege of common markup languages such as Textile, MediaWiki and Confluence it may be possible to have it work without markup language specific extensions.
Comment 1 Steffen Pingel CLA 2009-01-16 14:13:27 EST
Document refactoring through drag and drop. That's awesome :).
Comment 2 David Green CLA 2009-01-16 14:52:43 EST
(In reply to comment #1)
> Document refactoring through drag and drop. That's awesome :).

I'd love to take credit for the idea... but the WTP XML editor already does it
Comment 3 David Green CLA 2009-01-20 12:06:27 EST
Created attachment 123098 [details]
work to date, incomplete
Comment 4 David Green CLA 2009-01-20 12:06:30 EST
Created attachment 123099 [details]
mylyn/context/zip
Comment 5 David Green CLA 2009-01-20 23:02:22 EST
Created attachment 123155 [details]
working implementation with flaws

implemented, drag/drop appears to work well when dragging a single item.  A FIXME exists for fixing dragging multiple items.
Comment 6 David Green CLA 2009-01-20 23:02:28 EST
Created attachment 123156 [details]
mylyn/context/zip
Comment 7 David Green CLA 2009-01-21 20:10:44 EST
done
Comment 8 David Green CLA 2009-01-21 20:10:53 EST
Created attachment 123312 [details]
mylyn/context/zip
Comment 9 Steffen Pingel CLA 2009-01-21 20:32:46 EST
I am currently getting a test failure when running the headless test suite (same for the nightly build):

expected same:<org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem@16e9f8> was not:<org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem@0>
junit.framework.AssertionFailedError: expected same:<org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem@16e9f8> was not:<org.eclipse.mylyn.wikitext.core.parser.outline.OutlineItem@0>
	at org.eclipse.mylyn.wikitext.core.parser.outline.OutlineParserTest.testNearestItem(OutlineParserTest.java:53)
Comment 10 David Green CLA 2009-01-21 20:59:45 EST
(In reply to comment #9)
> I am currently getting a test failure when running the headless test suite (same
> for the nightly build):

ack! fixed in latest.