is there any way to add a custom contextual action bar when text is selected like this:

I have had a look around like here: http://developer.android.com/guide/topics/ui/menus.html#context-menu
But it really doesn’t have much information an the EditText selection.
I am using a physical Android 4.0.3 device so all the API is available to me.
Anyone have any ideas?
Edit for anyone who wants to know how to do this I documented the code here
I have made my own version of this editing the code a bit to meet my needs, I do not believe that there is any actual way of doing this.