orion.navigate.command | ||
---|---|---|
![]() |
![]() |
|
Plugging into the navigator | orion.navigate.openWith |
The orion.navigate.command service is used to contribute commands to the drop-down menu next to each file and folder. When the service is executed, the currently selected item in the Navigator is passed to the service's run method. The command can perform some operation on the provided selection, and optionally return an URL that the user will navigate to when clicking the command.
Implementations of orion.navigate.command must define the following function:
Implementations of orion.navigate.command may define the following attributes:
Here is a sample plug-in that contributes a link to a Google search for the selected file's name:
var provider = new eclipse.PluginProvider({postInstallUrl:"/plugin/list.html"}); provider.registerServiceProvider("orion.navigate.command", { run : function(item) { return "http://www.google.com/#q=" + item.Name; } }, { image: "http://www.google.com/favicon.ico", name: "Google Search", id: "sample.commands.sample4", forceSingleItem: true, href: true, tooltip: "Link to google search for this file name" }); provider.connect();
When this plug-in is installed, the user will see the google search command in the Navigator menu as follows:
For more examples of contributing Navigator commands see the sample commands plugin.
![]() |
![]() |
![]() |
Plugging into the navigator | orion.navigate.openWith |