@Override protected void onAttach() { super.onAttach(); name = String.valueOf(hashCode()); int col = 12 / tabPanel.getWidgetCount(); int index = tabPanel.getWidgetCount(); for (Widget w : tabPanel) { if (w instanceof ListItem) { if (!waves.isEmpty()) ((ListItem) w).getWidget(0).getElement().addClassName("waves-effect waves-" + waves); if (!color.isEmpty()) w.getElement().addClassName(color); if (!textColor.isEmpty()) ((ListItem) w).getWidget(0).getElement().addClassName(textColor + "-text"); ((ListItem) w).getWidget(0).getElement().setAttribute("href", "#" + name + index); w.addStyleName("tab col s" + col); index--; } } int indexC = contentPanel.getWidgetCount(); for (Widget w : contentPanel) { w.getElement().setAttribute("id", name + indexC); indexC--; } initTabs(); changeIndicator(indicatorColor); }
@UiChild(tagname = "tab") public void addTab(final Widget item) { CustomAnchor a = new CustomAnchor(); a.add(item); ListItem li = new ListItem(a); tabPanel.add(li); }