I found this code via the Joomla extensions page on http://extensions.joomla.org/extension/switch-editor
The code is originally from: http://www.joomler.net/download/140-joomla16-plugin/979-editor-switcher-for-joomla-25x-and-30-released.html
Since its open source but has not been updated since a few years I have choosen to upload my modification on Github.
I changed the switcher dropdown button to look more like the other bootstrap styled button next to it. This gives the buttons a more consistent look.