The simplest solution is to reuse OBCmdTestMethod.
When #executeTest is the method you defined in CmdActions for alt-t, then you can write:
executeTest
| target requestor |
requestor := model browser navigationPanel columns last.
target := model browser currentOrRootNode.
(OBCmdTestMethod on: target for: requestor) execute.
^true
This should do it when you need this action just for test methods.
Maybe you should also check whether target is indeed a test method.
David
Hi Hernan,
The tricky bit here is that in the code panel you're dealing with text,
not the nodes of the navigation graph. So all the commands appear in the
code pane menu operate on the current text selection, rather than the
currently selected node.
If you want to have your command be included in the text menu, simply
override OBCommand class>>wantsText. To implement #execute, you'll have
to get the current node from the command's requestor, since the
command's target will be an OBTextSelection.
Hope this helps,
Colin
To get the command included in the text menu, this works, but triggering the command
execution with a key stroke is not possible from a text panel. At least me couldn't
find a way.
David