private TreeObject createDummyModel ( ) { TreeObject to1 = new TreeObject ( "Inbox" ) ; TreeObject to2 = new TreeObject ( "Drafts" ) ; TreeObject to3 = new TreeObject ( "Sent" ) ; TreeParent p1 = new TreeParent ( "me@this.com" ) ; p1 . addChild ( to1 ) ; p1 . addChild ( to2 ) ; p1 . addChild ( to3 ) ; TreeObject to4 = new TreeObject ( "Inbox" ) ; TreeParent p2 = new TreeParent ( "other@aol.com" ) ; p2 . addChild ( to4 ) ; TreeParent root = new TreeParent ( "" ) ; root . addChild ( p1 ) ; root . addChild ( p2 ) ; return root ; }
We will set up a dummy model to initialize tree heararchy . In real code you will connect to a real model and expose its hierarchy .