/** * Locate the tab with the corresponding label, or create one if not found. * * @param name Label text of tab to find. * @return Tab corresponding to label text. * @throws Exception Unspecified exception. */ private ElementTabPane findTabPane(String name) throws Exception { ElementTabView tabView = getTabView(); ElementTabPane tabPane = null; while ((tabPane = tabView.getChild(ElementTabPane.class, tabPane)) != null) { if (name.equalsIgnoreCase(tabPane.getLabel())) { return tabPane; } } tabPane = new ElementTabPane(); tabPane.setParent(tabView); tabPane.setLabel(name); return tabPane; }