protected void renderTabbedRegionHeader() {
renderFragment("beforeTabs");
if (userAdmin)
renderTabbedDropRegion(0, !regionPanels.isEmpty());
LayoutRegionStatus regionStatus = SessionManager.getRegionStatus(currentSection, currentRegion);
if (regionStatus.getSelectedPanel() == null && !regionPanels.isEmpty()) {
regionStatus.setSelectedPanel((Panel) regionPanels.get(0));
}
for (int i = 0; i < regionPanels.size(); i++) {
Panel panel = regionPanels.get(i);
setAttribute("tabTitle", LocaleManager.lookup().localize(panel.getTitle()));
setAttribute("panel", panel);
setAttribute("dragEnabled", userAdmin);
setAttribute("url", UIServices.lookup().getUrlMarkupGenerator().getLinkToPanelAction(panel, "_select", true));
setAttribute("selected", regionStatus.isSelected(panel));
renderFragment("outputTab");
if (userAdmin)
renderTabbedDropRegion(i + 1, !regionPanels.isEmpty());
}
renderFragment("afterTabs");