Let shapeTree manage listmode and treemode