Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Documentation/Developer Guide/Plugging into the navigator"

(orion.navigate.command)
(orion.navigate.command)
Line 6: Line 6:
  
 
The <tt>orion.navigate.command</tt> service is used to contribute links 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 <tt>run</tt> method. The return value of this method is a URL string of the destination page for that command.
 
The <tt>orion.navigate.command</tt> service is used to contribute links 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 <tt>run</tt> method. The return value of this method is a URL string of the destination page for that command.
 +
 +
== Service methods ==
 +
 +
Implementations of <tt>orion.navigate.command</tt> must define the following function:
 +
 +
;run(selection)
 +
: Takes the navigator selection as an argument, and returns a URL string.
 +
 +
== Service attributes ==
  
 
Here is a sample plug-in that contributes a link to a Google search for the selected file's name:
 
Here is a sample plug-in that contributes a link to a Google search for the selected file's name:

Revision as of 10:57, 14 June 2011

Overview of contributing services to the Navigator

The Navigator page provides a view for users to browse and manipulate files in their workspace. The Navigator defines some services to allow plug-ins to contribute commands to this view.

orion.navigate.command

The orion.navigate.command service is used to contribute links 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 return value of this method is a URL string of the destination page for that command.

Service methods

Implementations of orion.navigate.command must define the following function:

run(selection)
Takes the navigator selection as an argument, and returns a URL string.

Service 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();

orion.navigate.openWith

Back to the top