CategoryNeedProofRead What was the question?
The basic idea is to combine a ContextAwareAction and a Presenter.Toolbar.
For details see this post, posted in this thread of the NetBeans mailing lists.