for (final Iterator<Component> i = getComponentIterator(); i.hasNext();) {
final Component component = i.next();
orphaned.remove(component);
Tab tab = tabs.get(component);
target.startTag("tab");
if (!tab.isEnabled() && tab.isVisible()) {
target.addAttribute("disabled", true);
}
if (!tab.isVisible()) {
target.addAttribute("hidden", true);
}
if (tab.isClosable()) {
target.addAttribute("closable", true);
}
final Resource icon = tab.getIcon();
if (icon != null) {
target.addAttribute("icon", icon);
}
final String caption = tab.getCaption();
if (caption != null && caption.length() > 0) {
target.addAttribute("caption", caption);
}
final String description = tab.getDescription();
if (description != null) {
target.addAttribute("description", description);
}
final ErrorMessage componentError = tab.getComponentError();
if (componentError != null) {
componentError.paint(target);
}
target.addAttribute("key", keyMapper.key(component));