reorder interface by responsibility

Signed-off-by: Florian Thienel <florian@thienel.org>
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/IVexWidget.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/IVexWidget.java
index 4958003..6e8f42d 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/IVexWidget.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/IVexWidget.java
@@ -11,15 +11,11 @@
  *******************************************************************************/
 package org.eclipse.vex.core.internal.widget;
 
-import java.io.IOException;
-import java.net.URL;
-
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.vex.core.internal.core.ElementName;
 import org.eclipse.vex.core.internal.css.IWhitespacePolicy;
 import org.eclipse.vex.core.internal.css.StyleSheet;
 import org.eclipse.vex.core.internal.layout.Box;
-import org.eclipse.vex.core.internal.layout.BoxFactory;
 import org.eclipse.vex.core.internal.undo.CannotRedoException;
 import org.eclipse.vex.core.internal.undo.CannotUndoException;
 import org.eclipse.vex.core.provisional.dom.ContentRange;
@@ -35,6 +31,146 @@
  * place to gather common Javadoc than as a way to enforce a contract.
  */
 public interface IVexWidget {
+
+	/*
+	 * Suspect
+	 */
+
+	/**
+	 * Returns the innermost box containing the current caret offset that matches the given filter.
+	 * 
+	 * TODO remove, the box model should not be leaked
+	 * 
+	 * @param filter
+	 *            IBoxFilter that determines which box to return
+	 */
+	Box findInnermostBox(IBoxFilter filter);
+
+	/*
+	 * Configuration
+	 */
+
+	/**
+	 * Returns the document associated with this component.
+	 */
+	IDocument getDocument();
+
+	/**
+	 * Sets a new document for this control.
+	 * 
+	 * @param document
+	 *            new Document to display
+	 * @param styleSheet
+	 *            StyleSheet to use for formatting
+	 */
+	void setDocument(IDocument document, StyleSheet styleSheet);
+
+	/**
+	 * Returns the style sheet used to format the document while editing.
+	 */
+	StyleSheet getStyleSheet();
+
+	/**
+	 * Sets the style sheet to be applied to the current document during editing. If no resolver has been set, the style
+	 * sheet will also be used for any subsequently loaded documents. If a resolver has been set, the style sheet
+	 * returned by the resolver will be used for subsequently loaded documents.
+	 * 
+	 * @param styleSheet
+	 *            the new StyleSheet to use
+	 */
+	void setStyleSheet(StyleSheet styleSheet);
+
+	/**
+	 * @return true if this widget is read-only
+	 */
+	boolean isReadOnly();
+
+	/**
+	 * Make this widget read-only.
+	 * 
+	 * @param readOnly
+	 *            set to true if this widget should be read-only
+	 */
+	void setReadOnly(boolean readOnly);
+
+	/**
+	 * Returns the value of the debugging flag.
+	 */
+	boolean isDebugging();
+
+	/**
+	 * Sets the value of the debugging flag. When debugging, copious information is dumped to stdout.
+	 * 
+	 * @param debugging
+	 *            true if debugging is to be enabled.
+	 */
+	void setDebugging(boolean debugging);
+
+	/*
+	 * Layout
+	 */
+
+	/**
+	 * Returns the width to which the document was layed out.
+	 */
+	int getLayoutWidth();
+
+	/**
+	 * Sets the width to which the document should be layed out. The actual resulting width may be different due to
+	 * overflowing boxes.
+	 */
+	void setLayoutWidth(int width);
+
+	/**
+	 * Return the offset into the document for the given coordinates.
+	 * 
+	 * @param x
+	 *            the x-coordinate
+	 * @param y
+	 *            the y-coordinate
+	 */
+	int viewToModel(int x, int y);
+
+	/*
+	 * Undo/Redo
+	 */
+
+	/**
+	 * Returns true if a redo can be performed.
+	 */
+	boolean canRedo();
+
+	/**
+	 * Redoes the last action on the redo stack.
+	 * 
+	 * @throws CannotRedoException
+	 *             if the last action cannot be re-done, or if there is nothing to redo.
+	 */
+	void redo() throws CannotRedoException;
+
+	/**
+	 * Returns true if an undo can be performed.
+	 */
+	boolean canUndo();
+
+	/**
+	 * Undoes the last action on the undo stack.
+	 * 
+	 * @throws CannotUndoException
+	 *             if the last action cannot be undone, or if there's nothing left to undo.
+	 */
+	void undo() throws CannotUndoException;
+
+	/**
+	 * Returns the number of undoable edits that have occurred on this document since editing has started, not including
+	 * limitations due to maximum undo depth.
+	 */
+	int getUndoDepth();
+
+	/*
+	 * Transaction Handling
+	 */
+
 	/**
 	 * Signals the start of a set of operations that should be considered a single unit for undo/redo purposes.
 	 * 
@@ -66,61 +202,7 @@
 	 * 
 	 * @see endWork(boolean)
 	 */
-	public void beginWork();
-
-	public boolean canInsertComment();
-
-	/**
-	 * Returns true if the clipboard has content that can be pasted. Used to enable/disable the paste action of a
-	 * containing application.
-	 */
-	public boolean canPaste();
-
-	/**
-	 * Returns true if the clipboard has plain text content that can be pasted. Used to enable/disable the "paste text"
-	 * action of a containing application.
-	 */
-	public boolean canPasteText();
-
-	/**
-	 * Returns true if a redo can be performed.
-	 */
-	public boolean canRedo();
-
-	/**
-	 * Returns true if an undo can be performed.
-	 */
-	public boolean canUndo();
-
-	/**
-	 * Returns true if the current element can be unwrapped, i.e. replaced with its content.
-	 */
-	public boolean canUnwrap();
-
-	/**
-	 * Copy the current selection to the clipboard.
-	 */
-	public void copySelection();
-
-	/**
-	 * Cuts the current selection to the clipboard.
-	 */
-	public void cutSelection();
-
-	/**
-	 * Deletes the character to the right of the caret.
-	 */
-	public void deleteNextChar() throws DocumentValidationException;
-
-	/**
-	 * Deletes the character to the left of the caret.
-	 */
-	public void deletePreviousChar() throws DocumentValidationException;
-
-	/**
-	 * Delete the current selection. Does nothing if there is no current selection.
-	 */
-	public void deleteSelection();
+	void beginWork();
 
 	/**
 	 * Perform the runnable's run method within a beginWork/endWork pair. All operations in the runnable are treated as
@@ -130,7 +212,7 @@
 	 * @param runnable
 	 *            Runnable implementing the work to be done.
 	 */
-	public void doWork(Runnable runnable);
+	void doWork(Runnable runnable);
 
 	/**
 	 * Perform the runnable's run method within a beginWork/endWork pair. All operations in the runnable are treated as
@@ -142,7 +224,7 @@
 	 * @param runnable
 	 *            Runnable implementing the work to be done.
 	 */
-	public void doWork(boolean savePosition, Runnable runnable);
+	void doWork(boolean savePosition, Runnable runnable);
 
 	/**
 	 * Signals the end of a set of operations that should be treated as a single unit for undo/redo purposes.
@@ -153,86 +235,264 @@
 	 * 
 	 * @see #beginWork()
 	 */
-	public void endWork(boolean success);
+	void endWork(boolean success);
 
 	/**
-	 * Returns the innermost box containing the current caret offset that matches the given filter.
+	 * Execute a Runnable, restoring the caret position to its original position afterward.
 	 * 
-	 * @param filter
-	 *            IBoxFilter that determines which box to return
+	 * @param runnable
+	 *            Runnable to be invoked.
 	 */
-	public Box findInnermostBox(IBoxFilter filter);
+	void savePosition(Runnable runnable);
+
+	/*
+	 * Clipboard cut/copy/paste
+	 */
 
 	/**
-	 * Returns the <code>BoxFactory</code> used for generating boxes in the layout.
+	 * Cuts the current selection to the clipboard.
 	 */
-	public BoxFactory getBoxFactory();
+	void cutSelection();
+
+	/**
+	 * Copy the current selection to the clipboard.
+	 */
+	void copySelection();
+
+	/**
+	 * Returns true if the clipboard has content that can be pasted. Used to enable/disable the paste action of a
+	 * containing application.
+	 */
+	boolean canPaste();
+
+	/**
+	 * Paste the current clipboard contents into the document at the current caret position.
+	 */
+	void paste() throws DocumentValidationException;
+
+	/**
+	 * Returns true if the clipboard has plain text content that can be pasted. Used to enable/disable the "paste text"
+	 * action of a containing application.
+	 */
+	boolean canPasteText();
+
+	/**
+	 * Paste the current clipboard contents as plain text into the document at the current caret position.
+	 */
+	void pasteText() throws DocumentValidationException;
+
+	/*
+	 * Caret and Selection
+	 */
 
 	/**
 	 * Return the offset into the document represented by the caret.
 	 */
-	public int getCaretOffset();
+	int getCaretOffset();
 
 	/**
 	 * Returns the element at the current caret offset.
 	 */
-	public IElement getCurrentElement();
+	IElement getCurrentElement();
 
 	/**
 	 * Returns the node a the current caret offset.
 	 */
-	public INode getCurrentNode();
-
-	/**
-	 * Returns the document associated with this component.
-	 */
-	public IDocument getDocument();
-
-	/**
-	 * Returns the width to which the document was layed out.
-	 */
-	public int getLayoutWidth();
+	INode getCurrentNode();
 
 	/**
 	 * Returns the offset range in the content which is selected.
 	 */
-	public ContentRange getSelectedRange();
+	ContentRange getSelectedRange();
 
 	/**
 	 * Returns the currently selected document fragment, or null if there is no current selection.
 	 */
-	public IDocumentFragment getSelectedFragment();
+	IDocumentFragment getSelectedFragment();
 
 	/**
 	 * Returns the currently selected string, or an empty string if there is no current selection.
 	 */
-	public String getSelectedText();
-
-	/**
-	 * Returns the style sheet used to format the document while editing.
-	 */
-	public StyleSheet getStyleSheet();
-
-	/**
-	 * Returns the number of undoable edits that have occurred on this document since editing has started, not including
-	 * limitations due to maximum undo depth.
-	 */
-	public int getUndoDepth();
-
-	/**
-	 * Returns an array of names of elements that are valid to insert at the given caret offset and selection
-	 */
-	public ElementName[] getValidInsertElements();
-
-	/**
-	 * Returns an array of names of elements to which the element at the current caret location can be morphed.
-	 */
-	public ElementName[] getValidMorphElements();
+	String getSelectedText();
 
 	/**
 	 * Returns true if the user currently has some text selected.
 	 */
-	public boolean hasSelection();
+	boolean hasSelection();
+
+	/**
+	 * Selects all content in the document.
+	 */
+	void selectAll();
+
+	/**
+	 * Selects the word at the current caret offset.
+	 */
+	void selectWord();
+
+	/*
+	 * Caret Movement
+	 */
+
+	/**
+	 * Moves the caret a given distance relative to the current caret offset.
+	 * 
+	 * @param distance
+	 *            Amount by which to alter the caret offset. Positive values increase the caret offset.
+	 */
+	void moveBy(int distance);
+
+	/**
+	 * Moves the caret a given distance relative to the current caret offset.
+	 * 
+	 * @param distance
+	 *            Amount by which to alter the caret offset. Positive values increase the caret offset.
+	 * @param select
+	 *            if true, the current selection is extended to match the new caret offset
+	 */
+	void moveBy(int distance, boolean select);
+
+	/**
+	 * Moves the caret to a new offset. The selection is not extended. This is equivalent to
+	 * <code>moveTo(offset, false)</code>.
+	 * 
+	 * @param int new offset for the caret. The offset must be >= 1 and less than the document size; if not, it is
+	 *        silently ignored.
+	 */
+	void moveTo(int offset);
+
+	/**
+	 * Moves the caret to the new offset, possibly changing the selection.
+	 * 
+	 * @param int new offset for the caret. The offset must be >= 1 and less than the document size; if not, it is
+	 *        silently ignored.
+	 * @param select
+	 *            if true, the current selection is extended to match the new caret offset.
+	 */
+	void moveTo(int offset, boolean select);
+
+	/**
+	 * Move the caret to the end of the current line.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToLineEnd(boolean select);
+
+	/**
+	 * Move the caret to the start of the current line.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToLineStart(boolean select);
+
+	/**
+	 * Move the caret down to the next line. Attempts to preserve the same distance from the left edge of the control.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToNextLine(boolean select);
+
+	/**
+	 * Move the caret down to the next page. Attempts to preserve the same distance from the left edge of the control.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToNextPage(boolean select);
+
+	/**
+	 * Moves the caret to the end of the current or next word.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToNextWord(boolean select);
+
+	/**
+	 * Moves the caret up to the previous line.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended
+	 */
+	void moveToPreviousLine(boolean select);
+
+	/**
+	 * Moves the caret up to the previous page.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended
+	 */
+	void moveToPreviousPage(boolean select);
+
+	/**
+	 * Moves the caret to the start of the current or previous word.
+	 * 
+	 * @param select
+	 *            If true, the selection is extended.
+	 */
+	void moveToPreviousWord(boolean select);
+
+	/*
+	 * Deletion
+	 */
+
+	/**
+	 * Deletes the character to the right of the caret.
+	 */
+	void deleteNextChar() throws DocumentValidationException;
+
+	/**
+	 * Deletes the character to the left of the caret.
+	 */
+	void deletePreviousChar() throws DocumentValidationException;
+
+	/**
+	 * Delete the current selection. Does nothing if there is no current selection.
+	 */
+	void deleteSelection();
+
+	/*
+	 * Namespaces
+	 */
+
+	void declareNamespace(final String namespacePrefix, final String namespaceURI);
+
+	void removeNamespace(final String namespacePrefix);
+
+	void declareDefaultNamespace(final String namespaceURI);
+
+	void removeDefaultNamespace();
+
+	/*
+	 * Attributes
+	 */
+
+	/**
+	 * Sets the value of an attribute in the current element. Attributes set in this manner (as opposed to calling
+	 * Element.setAttribute directly) will be subject to undo/redo.
+	 * 
+	 * @param attributeName
+	 *            local name of the attribute being changed.
+	 * @param value
+	 *            New value for the attribute. If null, the attribute is removed from the element.
+	 */
+	void setAttribute(String attributeName, String value);
+
+	/**
+	 * Removes an attribute from the current element. Attributes removed in this manner (as opposed to calling
+	 * Element.setAttribute directly) will be subject to undo/redo.
+	 * 
+	 * @param attributeName
+	 *            local name of the attribute to remove.
+	 */
+	void removeAttribute(String attributeName);
+
+	/*
+	 * Content
+	 */
 
 	/**
 	 * Inserts the given character at the current caret position. Any selected content is deleted. The main difference
@@ -243,15 +503,29 @@
 	 * @param c
 	 *            Character to insert.
 	 */
-	public void insertChar(char c) throws DocumentValidationException;
+	void insertChar(char c) throws DocumentValidationException;
 
 	/**
-	 * Inserts the given document fragment at the current caret position. Any selected content is deleted.
+	 * Inserts the given text at the current caret position. Any selected content is first deleted.
 	 * 
-	 * @param frag
-	 *            DocumentFragment to insert.
+	 * @param text
+	 *            String to insert.
 	 */
-	public void insertFragment(IDocumentFragment frag) throws DocumentValidationException;
+	void insertText(String text) throws DocumentValidationException;
+
+	/*
+	 * Structure
+	 */
+
+	/**
+	 * Returns an array of names of elements that are valid to insert at the given caret offset and selection
+	 */
+	ElementName[] getValidInsertElements();
+
+	/**
+	 * Returns an array of names of elements to which the element at the current caret location can be morphed.
+	 */
+	ElementName[] getValidMorphElements();
 
 	/**
 	 * Inserts the given element at the current caret position. Any selected content becomes the new contents of the
@@ -261,15 +535,9 @@
 	 *            Qualified name of the element to insert.
 	 * @return the newly inserted element
 	 */
-	public IElement insertElement(QualifiedName elementName) throws DocumentValidationException;
+	IElement insertElement(QualifiedName elementName) throws DocumentValidationException;
 
-	/**
-	 * Inserts the given text at the current caret position. Any selected content is first deleted.
-	 * 
-	 * @param text
-	 *            String to insert.
-	 */
-	public void insertText(String text) throws DocumentValidationException;
+	boolean canInsertComment();
 
 	/**
 	 * Inserts the given XML fragment at the current caret position. Any selected content is first deleted.
@@ -285,24 +553,20 @@
 	 * 
 	 * @return the new comment
 	 */
-	public IComment insertComment() throws DocumentValidationException;
+	IComment insertComment() throws DocumentValidationException;
 
 	/**
-	 * Returns the value of the debugging flag.
-	 */
-	public boolean isDebugging();
-
-	/**
-	 * Sets the value of the debugging flag. When debugging, copious information is dumped to stdout.
+	 * Inserts the given document fragment at the current caret position. Any selected content is deleted.
 	 * 
-	 * @param debugging
-	 *            true if debugging is to be enabled.
+	 * @param frag
+	 *            DocumentFragment to insert.
 	 */
-	public void setDebugging(boolean debugging);
+	void insertFragment(IDocumentFragment frag) throws DocumentValidationException;
 
-	public boolean isReadOnly();
-
-	public void setReadOnly(boolean readOnly);
+	/**
+	 * Returns true if the current element can be unwrapped, i.e. replaced with its content.
+	 */
+	boolean canUnwrap();
 
 	/**
 	 * Replaces the current element with an element with the given name. The content of the element is preserved.
@@ -313,206 +577,7 @@
 	 *             if the given element is not valid at this place in the document, or if the current element's content
 	 *             is not compatible with the given element.
 	 */
-	public void morph(QualifiedName elementName) throws DocumentValidationException;
-
-	/**
-	 * Moves the caret a given distance relative to the current caret offset.
-	 * 
-	 * @param distance
-	 *            Amount by which to alter the caret offset. Positive values increase the caret offset.
-	 */
-	public void moveBy(int distance);
-
-	/**
-	 * Moves the caret a given distance relative to the current caret offset.
-	 * 
-	 * @param distance
-	 *            Amount by which to alter the caret offset. Positive values increase the caret offset.
-	 * @param select
-	 *            if true, the current selection is extended to match the new caret offset
-	 */
-	public void moveBy(int distance, boolean select);
-
-	/**
-	 * Moves the caret to a new offset. The selection is not extended. This is equivalent to
-	 * <code>moveTo(offset, false)</code>.
-	 * 
-	 * @param int new offset for the caret. The offset must be >= 1 and less than the document size; if not, it is
-	 *        silently ignored.
-	 */
-	public void moveTo(int offset);
-
-	/**
-	 * Moves the caret to the new offset, possibly changing the selection.
-	 * 
-	 * @param int new offset for the caret. The offset must be >= 1 and less than the document size; if not, it is
-	 *        silently ignored.
-	 * @param select
-	 *            if true, the current selection is extended to match the new caret offset.
-	 */
-	public void moveTo(int offset, boolean select);
-
-	/**
-	 * Move the caret to the end of the current line.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToLineEnd(boolean select);
-
-	/**
-	 * Move the caret to the start of the current line.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToLineStart(boolean select);
-
-	/**
-	 * Move the caret down to the next line. Attempts to preserve the same distance from the left edge of the control.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToNextLine(boolean select);
-
-	/**
-	 * Move the caret down to the next page. Attempts to preserve the same distance from the left edge of the control.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToNextPage(boolean select);
-
-	/**
-	 * Moves the caret to the end of the current or next word.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToNextWord(boolean select);
-
-	/**
-	 * Moves the caret up to the previous line.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended
-	 */
-	public void moveToPreviousLine(boolean select);
-
-	/**
-	 * Moves the caret up to the previous page.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended
-	 */
-	public void moveToPreviousPage(boolean select);
-
-	/**
-	 * Moves the caret to the start of the current or previous word.
-	 * 
-	 * @param select
-	 *            If true, the selection is extended.
-	 */
-	public void moveToPreviousWord(boolean select);
-
-	/**
-	 * Paste the current clipboard contents into the document at the current caret position.
-	 */
-	public void paste() throws DocumentValidationException;
-
-	/**
-	 * Paste the current clipboard contents as plain text into the document at the current caret position.
-	 */
-	public void pasteText() throws DocumentValidationException;
-
-	/**
-	 * Redoes the last action on the redo stack.
-	 * 
-	 * @throws CannotRedoException
-	 *             if the last action cannot be re-done, or if there is nothing to redo.
-	 */
-	public void redo() throws CannotRedoException;
-
-	/**
-	 * Removes an attribute from the current element. Attributes removed in this manner (as opposed to calling
-	 * Element.setAttribute directly) will be subject to undo/redo.
-	 * 
-	 * @param attributeName
-	 *            Name of the attribute to remove.
-	 */
-	public void removeAttribute(String attributeName);
-
-	/**
-	 * Execute a Runnable, restoring the caret position to its original position afterward.
-	 * 
-	 * @param runnable
-	 *            Runnable to be invoked.
-	 */
-	public void savePosition(Runnable runnable);
-
-	/**
-	 * Selects all content in the document.
-	 */
-	public void selectAll();
-
-	/**
-	 * Selects the word at the current caret offset.
-	 */
-	public void selectWord();
-
-	/**
-	 * Sets the value of an attribute in the current element. Attributes set in this manner (as opposed to calling
-	 * Element.setAttribute directly) will be subject to undo/redo.
-	 * 
-	 * @param attributeName
-	 *            Name of the attribute being changed.
-	 * @param value
-	 *            New value for the attribute. If null, the attribute is removed from the element.
-	 */
-	public void setAttribute(String attributeName, String value);
-
-	/**
-	 * Sets the box factory to be applied to the current document during editing.
-	 * 
-	 * @param boxFactory
-	 *            the new BoxFactory to use
-	 */
-	public void setBoxFactory(BoxFactory boxFactory);
-
-	/**
-	 * Sets a new document for this control.
-	 * 
-	 * @param document
-	 *            new Document to display
-	 * @param styleSheet
-	 *            StyleSheet to use for formatting
-	 */
-	public void setDocument(IDocument document, StyleSheet styleSheet);
-
-	/**
-	 * Sets the width to which the document should be layed out. The actual resulting width may be different due to
-	 * overflowing boxes.
-	 */
-	public void setLayoutWidth(int width);
-
-	/**
-	 * Sets the style sheet to be applied to the current document during editing. If no resolver has been set, the style
-	 * sheet will also be used for any subsequently loaded documents. If a resolver has been set, the style sheet
-	 * returned by the resolver will be used for subsequently loaded documents.
-	 * 
-	 * @param styleSheet
-	 *            the new StyleSheet to use
-	 */
-	public void setStyleSheet(StyleSheet styleSheet);
-
-	/**
-	 * Sets the stylesheet to be used for this widget.
-	 * 
-	 * @param ssUrl
-	 *            URL of the CSS style sheet to use.
-	 */
-	public void setStyleSheet(URL ssUrl) throws IOException;
+	void morph(QualifiedName elementName) throws DocumentValidationException;
 
 	public void setWhitespacePolicy(IWhitespacePolicy whitespacePolicy);
 
@@ -521,32 +586,6 @@
 	/**
 	 * Split the element at the current caret offset. This is the normal behaviour when the user presses Enter.
 	 */
-	public void split() throws DocumentValidationException;
-
-	/**
-	 * Undoes the last action on the undo stack.
-	 * 
-	 * @throws CannotUndoException
-	 *             if the last action cannot be undone, or if there's nothing left to undo.
-	 */
-	public void undo() throws CannotUndoException;
-
-	/**
-	 * Return the offset into the document for the given coordinates.
-	 * 
-	 * @param x
-	 *            the x-coordinate
-	 * @param y
-	 *            the y-coordinate
-	 */
-	public int viewToModel(int x, int y);
-
-	public void declareNamespace(final String namespacePrefix, final String namespaceURI);
-
-	public void removeNamespace(final String namespacePrefix);
-
-	public void declareDefaultNamespace(final String namespaceURI);
-
-	public void removeDefaultNamespace();
+	void split() throws DocumentValidationException;
 
 }
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/VexWidgetImpl.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/VexWidgetImpl.java
index dc85a67..ad220c6 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/VexWidgetImpl.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/widget/VexWidgetImpl.java
@@ -111,7 +111,7 @@
 	private StyleSheet styleSheet;
 	private IWhitespacePolicy whitespacePolicy = IWhitespacePolicy.NULL;
 
-	private BoxFactory boxFactory = new CssBoxFactory();
+	private final BoxFactory boxFactory = new CssBoxFactory();
 
 	private RootBox rootBox;
 
@@ -548,10 +548,6 @@
 		return styleSheet.getStyles(document.getRootElement()).getBackgroundColor();
 	}
 
-	public BoxFactory getBoxFactory() {
-		return boxFactory;
-	}
-
 	/**
 	 * Returns the current caret.
 	 */
@@ -1393,13 +1389,6 @@
 		}
 	}
 
-	public void setBoxFactory(final BoxFactory boxFactory) {
-		this.boxFactory = boxFactory;
-		if (document != null) {
-			relayout();
-		}
-	}
-
 	public void setDebugging(final boolean debugging) {
 		this.debugging = debugging;
 	}
@@ -1676,7 +1665,7 @@
 	 */
 	private LayoutContext createLayoutContext(final Graphics g) {
 		final LayoutContext context = new LayoutContext();
-		context.setBoxFactory(getBoxFactory());
+		context.setBoxFactory(boxFactory);
 		context.setDocument(getDocument());
 		context.setGraphics(g);
 		context.setStyleSheet(getStyleSheet());
diff --git a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/VexWidget.java b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/VexWidget.java
index e493676..26495ab 100644
--- a/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/VexWidget.java
+++ b/org.eclipse.vex.ui/src/org/eclipse/vex/ui/internal/swt/VexWidget.java
@@ -64,7 +64,6 @@
 import org.eclipse.vex.core.internal.dom.DocumentFragment;
 import org.eclipse.vex.core.internal.io.XMLFragment;
 import org.eclipse.vex.core.internal.layout.Box;
-import org.eclipse.vex.core.internal.layout.BoxFactory;
 import org.eclipse.vex.core.internal.widget.IBoxFilter;
 import org.eclipse.vex.core.internal.widget.IHostComponent;
 import org.eclipse.vex.core.internal.widget.IVexWidget;
@@ -223,10 +222,6 @@
 		return impl.findInnermostBox(filter);
 	}
 
-	public BoxFactory getBoxFactory() {
-		return impl.getBoxFactory();
-	}
-
 	public int getCaretOffset() {
 		return impl.getCaretOffset();
 	}
@@ -409,10 +404,6 @@
 		impl.setAttribute(attributeName, value);
 	}
 
-	public void setBoxFactory(final BoxFactory boxFactory) {
-		impl.setBoxFactory(boxFactory);
-	}
-
 	public void setDebugging(final boolean debugging) {
 		impl.setDebugging(debugging);
 	}