package testgwt3.com.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.TreeModelType;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tree.Tree;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeNode;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Testgwt3 implements EntryPoint {
	
public void onModuleLoad() {
	createWindow();
			
		
	}

	public void createWindow(){
		final Window Window = new com.smartgwt.client.widgets.Window(); 
		Window.setWidth(600);
		Window.setHeight(550);
		Window.setTitle("testgrid");
		Window.setShowMinimizeButton(false);
		Window.setIsModal(true);
		Window.setShowModalMask(true);
		Window.centerInPage();
		
		
		VLayout vLout=new VLayout();
		vLout.setTop(25);
		vLout.setWidth(200);
		vLout.setHeight(500);
		vLout.setBorder("1px solid gray");
				
		
		TreeGrid treeGrid=new TreeGrid();
		treeGrid.setWidth100();
		treeGrid.setHeight100();
		//treeGrid.setShowHeader(false);
		treeGrid.setLoadDataOnDemand(false);
		treeGrid.setSelectionType(SelectionStyle.SINGLE);
		treeGrid.setFixedFieldWidths(false);
		
		
		Tree data = new Tree();
		 data.setModelType(TreeModelType.CHILDREN);
		 
        data.setRoot(
                new TreeNode("root", 
                        new TreeNode("File",
                                new TreeNode("FileChild")), 
                        new TreeNode("Edit",
                                new TreeNode("EditChild",
                                        new TreeNode("EditGrandChildddddddddddddddddddds"))), 
                        new TreeNode("Windows"))
        );
        
        treeGrid.setData(data);

		
		 Window.show();	
		 vLout.addChild(treeGrid);
		Window.addChild(vLout);
		
		
	}
	}

