Moved tab logic to the PanelController.