Tue 19 Aug 2008
Better way to find Eclipse command Ids, and more…
Posted by Ryan under Code Editors, Productivity, SlickEdit Products
No Comments
Core 3.4.0 introduced the Slick-C function _eclipse_execute_command which allows you to execute Eclipse commands from the SlickEdit environment. The documentation for this function shows you how you can search the Plug-in Registry to find Eclipse command names and ids, but there is a much better way documented in the following blog post: http://evans-stuff.blogspot.com/2007/10/it-seems-that-im-not-only-one-still.html .
Unfortunately I discovered this technique after we finished the documentation and shipped the plug-in, but hopefully me pointing it out here may help some users.
Also, don’t forget the “Activate Editor” command in Eclipse (F12 by default). If you are using _eclipse_execute_command to jump into different Eclipse Views and search around mouse-less, hitting F12 will jump you back into the last active editor.
<update>
Check out this thread of the SlickEdit Forums for adding a generic Eclipse Pass-through Command: http://community.slickedit.com/index.php?topic=3549.0
From the post:
If you are evaluating 3.4.0 for your company, you can make this happen easily. One of the best features in Core 3.4.0 is the introduction of _eclipse_execute_command, which is discussed in the user guide/readme, and also a little more in my post here: http://community.slickedit.com/index.php?topic=3816.0 . This is the idea that Rob suggests in this thread.
I’ll take this opportunity to give a brief tutorial on how to integrate that “Activate Task” shortcut into the SlickEdit environment.
First you need to know the command id of what you are trying to execute. I used the method described http://evans-stuff.blogspot.com/2007/10/it-seems-that-im-not-only-one-still.html , in which you create a Simple Cheat Sheet and use the Command Browse button (see first screenshot).

Then I just used the search field to find the command (see second screenshot).
Now that I had the command/parameter info, I opened up the Slick-C macro file where I write my custom commands (ryan.e), and added functions for Activate Task and Deactivate Task using _eclipse_execute_command (see third screenshot). Remember to load your macro file with F12 after writing the functions.
Then I used the SlickEdit Keybindings dialog to bind eclipse_activate_task to Ctrl + F9 (see fourth screenshot), and voila. Hitting Ctrl + F9 in a SlickEdit editor will launch the Mylyn Activate Task dialog.
It may seem like a lot of steps, but it’s really not. This whole process took me less than 10 minutes including the time I took to capture/crop/annotate the screenshots. You can use this method to execute almost any Eclipse command from any plug-in from the SlickEdit environment.
- Ryan


