@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!RenderKitUtils.assertValid(context, component)) {
return;
}
final UIBodyDockWrapper uibw = (UIBodyDockWrapper) component;
//Fix this div id for help Mocha to know where start the pageWrapper
uibw.setId(DOCKWRAPPER_ID);
if (uibw.getChildren() != null) {
uibw.getChildren().clear();
}
final UIDiv dock = new UIDiv();
final UIDiv dockPlacement = new UIDiv();
final UIDiv dockAutoHide = new UIDiv();
final UIDiv dockSort = new UIDiv();
final UIDiv dockClear = new UIDiv();
dock.setId(DOCK_ID);
dockPlacement.setId(DOCKPLACEMENT_ID);
dockAutoHide.setId(DOCKAUTOHIDE_ID);
dockSort.setId(DOCKSORT_ID);
dockClear.setId(DOCKCLEAR_ID);
dockClear.setStyleClass(DOCKCLEAR_CLASS);
dock.getChildren().add(dockPlacement);
dock.getChildren().add(dockAutoHide);
dockSort.getChildren().add(dockClear);
dock.getChildren().add(dockSort);
uibw.getChildren().add(dock);
super.encodeBegin(context, uibw);
}