@Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
UITreeNode node = (UITreeNode) component;
UITree root = node.findTree();
MixedTreeModel mixedModel = root.getModel();
mixedModel.onEncodeBegin();
TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
String treeId = root.getClientId(facesContext);
DefaultMutableTreeNode modelNode = (DefaultMutableTreeNode) node.getValue();
boolean folder = mixedModel.isFolder();
boolean marked = node.isMarked();
String id = node.getClientId(facesContext);
boolean menuMode = root.getMode().equals("menu");
boolean showIcons = root.isShowIcons();
boolean showJunctions = root.isShowJunctions();
boolean showRootJunction = root.isShowRootJunction();
boolean showRoot = root.isShowRoot();
int depth = mixedModel.getDepth();
boolean isRoot = mixedModel.isRoot();
boolean expanded = node.isExpanded() || (isRoot && !showRoot);
boolean hasNextSibling = mixedModel.hasCurrentNodeNextSibling();
List<Boolean> junctions = mixedModel.getJunctions();
if (!showRoot && junctions.size() > 0) {
junctions.remove(0);
}