_viewer = viewer;
}
public void execute() {
Node document = _viewer.getModel().getDocument();
IMovementMediator validator = new InlineEditingNavigationMediator(
new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
Node htmlRoot = RootContainerPositionRule
.getBasicContainer((Document) document);
Node jsfRoot = JSFRootContainerPositionRule
.getBasicContainer((Document) document, 3);
Node root;
if (htmlRoot != null && jsfRoot != null) {
if (EditModelQuery.isChild(htmlRoot, jsfRoot)) {
root = htmlRoot;
} else if (EditModelQuery.isChild(jsfRoot, htmlRoot)) {
root = jsfRoot;
} else {
root = htmlRoot;
}
} else {
if (htmlRoot != null) {
root = htmlRoot;
} else if (jsfRoot != null) {
root = jsfRoot;
} else {
root = document;
}
}
IDOMPosition position1, position2;
// if (root.hasChildNodes())
// {
// Node first = root.getFirstChild();
// position1 = new DOMRefPosition(first, false);
// Node last = root.getLastChild();
// position2 = new DOMRefPosition(last, true);
// }
// else
// {
position1 = new DOMPosition(root, 0);
position2 = new DOMPosition(root, root.getChildNodes().getLength());
// }
if (!validator.isValidPosition(position1)) {
position1 = EditHelper.moveToNextEditPosition(position1, true,
validator);
}
if (!validator.isValidPosition(position2)) {
position2 = EditHelper.moveToNextEditPosition(position2, false,
validator);
}
if (EditValidateUtil.validPosition(position1)
&& EditValidateUtil.validPosition(position2)) {