public class PocTreeView {

    /**
     * The section items.
     */
    private SectionItem pocTreeSectionItem;

    /**
     * Constructor
     */
    public PocTreeFormView() {
        // ///////////////////
        // Form Layout //
        // ///////////////////
        form.setID("PocTreeView_form");
        form.setNumCols(4);
        form.setHeight100();
        form.setWidth100();

        pocTreeSectionItem = new SectionItem();

        pocTreeSectionItem.setDefaultValue("Poc Tree");

        // ////////////////////////////////
        // Form section : POC Tree //
        // ////////////////////////////////
        VLayout treeLayout = new VLayout();
        treeLayout.setWidth("*");

        ResultTree tree = new ResultTree();
        tree.setModelType(TreeModelType.PARENT);
        tree.setNameProperty("Name");
        tree.setIdField("NodeId");
        tree.setParentIdField("ReportsTo");
        tree.setIsFolderProperty("isFolder");
        tree.setDefaultIsFolder(false);
        tree.setShowRoot(true);

        TreeGrid treeGrid = new TreeGrid();
        treeGrid.setDataProperties(tree);
        treeGrid.setDataSource(EmployeeXmlDS.getInstance());
        treeGrid.setWidth("100%");
        treeGrid.setAutoFetchData(true);
        treeGrid.setNodeIcon("star.png");
        treeGrid.setFolderIcon("add.png");
        treeGrid.setSaveLocally(false);
        treeGrid.setShowConnectors(false);
        treeGrid.setShowHeader(false);
        treeGrid.setShowOpener(true);
        treeGrid.setAlwaysShowOpener(true);
        treeGrid.setIconSize(24);
        treeGrid.setShowOpenIcons(true);
        treeGrid.setShowDropIcons(false);
        treeGrid.setSelectionType(SelectionStyle.SINGLE);

        treeLayout.addMember(treeGrid);

        CanvasItem myCanvas = new CanvasItem("myCanvas_pocTree");
        myCanvas.setCanvas(treeLayout);
        myCanvas.setStartRow(true);
        myCanvas.setEndRow(true);
        myCanvas.setWidth("*");
        myCanvas.setHeight("*");
        myCanvas.setColSpan("*");
        myCanvas.setShowTitle(false);

        pocTreeSectionItem.setItemIds(myCanvas.getName());

        form.setItems(pocTreeSectionItem, myCanvas);
        // ////////////////////////////////
        // Add sections and items to form. //
        // ////////////////////////////////

        addMember(form);
    }
}
