public void testSplitterOrder() { SplitLayoutPanel p = new SplitLayoutPanel(); WidgetCollection children = p.getChildren(); Label l0 = new Label("foo"); Label l1 = new Label("bar"); Label l2 = new Label("baz"); Label l3 = new Label("tintin"); Label l4 = new Label("toto"); p.addWest(l0, 64); assertEquals(l0, children.get(0)); assertEquals(SplitLayoutPanel.HSplitter.class, children.get(1).getClass()); p.addNorth(l1, 64); assertEquals(l1, children.get(2)); assertEquals(SplitLayoutPanel.VSplitter.class, children.get(3).getClass()); p.addEast(l2, 64); assertEquals(l2, children.get(4)); assertEquals(SplitLayoutPanel.HSplitter.class, children.get(5).getClass()); p.addSouth(l3, 64); assertEquals(l3, children.get(6)); assertEquals(SplitLayoutPanel.VSplitter.class, children.get(7).getClass()); p.add(l4); assertEquals(l4, children.get(8)); }
public void addChild(HasWidgets container, Widget child) { ((SplitLayoutPanel) container).addNorth(child, 10); }