The context menu for the SlickEdit editor is controlled by our binaries. And the commands that can go on that menu have to be entries in our Slick-C macro language (and not commands that are exposed via Eclipse). We do provide a function in our Slick-C code that will invoke an Eclipse-defined command.
The first step is to create a new SlickEdit macro file, with a .e extension. You can start with the below example
#include "slick.sh"
_command void SampleMenuCommand()
{
// Slick-C triggering a native Eclipse command
_eclipse_execute_command("org.eclipse.ui.newWizard","","");
}
Save that as sample.e, and then use the Macro > Load Module… menu command and browse to that file. It will compile and load it into our Slick-C runtime. That SampleMenuCommand is now available to be bound to an entry in one of our menus.
That example above has two empty arguments at the end. The middle argument is for a list of comma-separated parameter names, and the last argument is for a comma-separated list of parameter values.
Here's an example from our own macro source that uses these parameters
/**
* Activates the Outline view in Eclipse.
*/
_command void eclipse_show_outline() name_info(',')
{
if (isEclipsePlugin()) {
_eclipse_execute_command("org.eclipse.ui.views.showView","org.eclipse.ui.views.showView.viewId,org.eclipse.ui.views.showView.makeFast", "org.eclipse.ui.views.ContentOutline,false");
} else {
activate_defs();
}
}