Headings Not Shown When Adding Custom Source
So I have my headings displaying now but this is more of a flawed workaround than an answer.

Basically when the ElementIndexesService-&gt;getSources() function finds element index settings it then works through the sources ordering them and applying headings based on the settings.

As my sources are custom ones added by a plugin they don't exist in the settings. Because of this they are shuffled to the end of the list and the headings are removed.

My fix is to add them to the settings in the database. This can be done using... 

$elementIndexesService = new ElementIndexesService();
$settings = $elementIndexesService-&gt;getSettings(ElementType::Entry);
// and
$elementIndexesService-&gt;setSettings(ElementType::Entry, $settings);


$settings consists of two sub arrays containing the sources and their order. By adding my custom sources to these everything appears in the entries index as planned.

The flaws are that I now need to maintain this whenever the entries that effect the sources are created or deleted. Also the index settings modal overwrites the settings in the database so again I have to maintain it if they are changed.