Community
Participate
Working Groups
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.
Document refactoring through drag and drop. That's awesome :).
(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
Created attachment 123098 [details] work to date, incomplete
Created attachment 123099 [details] mylyn/context/zip
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.
Created attachment 123156 [details] mylyn/context/zip
done
Created attachment 123312 [details] mylyn/context/zip
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)
(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.