@Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); sandbox = comp.getFirstChild(); }
/** * Adds a component to the toolbar. * * @param component Component to add. If the component is a toolbar itself, its children will be * added to the toolbar. * @param action The action to associate with the component. */ public void addToolbarComponent(BaseComponent component, String action) { BaseComponent ref = toolbar.getFirstChild(); if (component instanceof Toolbar) { BaseComponent child; while ((child = component.getFirstChild()) != null) { toolbar.addChild(child, ref); } } else { toolbar.addChild(component, ref); ActionUtil.addAction(component, action); } }
private void test(BaseComponent root, String eventName, int eventData, int expectedSize) { String labelText = eventName + "." + eventData; EventManager.getInstance().fireLocalEvent(eventName, labelText); getMockEnvironment().flushEvents(); assertEquals(expectedSize, root.getChildren().size()); Label label = (Label) root.getChildren().get(expectedSize - 1).getFirstChild(); assertEquals(labelText, label.getLabel()); } }