ScrollPanel staticTreeWrapper = new ScrollPanel(staticTree);
staticTreeWrapper.ensureDebugId("cwTree-staticTree-Wrapper");
staticTreeWrapper.setSize("300px", "300px");
// Wrap the static tree in a DecoratorPanel
DecoratorPanel staticDecorator = new DecoratorPanel();
staticDecorator.setWidget(staticTreeWrapper);
// Create a dynamically generated tree and a container to hold it
final Tree dynamicTree = createDynamicTree();
dynamicTree.ensureDebugId("cwTree-dynamicTree");
ScrollPanel dynamicTreeWrapper = new ScrollPanel(dynamicTree);
dynamicTreeWrapper.ensureDebugId("cwTree-dynamicTree-Wrapper");
dynamicTreeWrapper.setSize("300px", "300px");
// Wrap the dynamic tree in a DecoratorPanel
DecoratorPanel dynamicDecorator = new DecoratorPanel();
dynamicDecorator.setWidget(dynamicTreeWrapper);
// Combine trees onto the page
Grid grid = new Grid(2, 3);
grid.setCellPadding(2);
grid.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP);