Orion/Documentation/Developer Guide/Simple plugin example
This page explains how to write a plugin for Orion. It's intended for developers who want to extend Orion's functionality.
What's a plugin?
In order to be useful, a plugin should provide one or more services. When Orion needs a service contributed by a plugin, it loads the plugin inside an IFrame.
Orion currently supports a small set of extension points — service types that plugins can contribute to, in order to customize the client and add more functionality. These include:
- Commands on the editor toolbar
- Commands in the navigator view
- Content assist
- Syntax highlighting
Before you start
- OpenAjax: OpenAjaxManagedHub-all.js
- Orion Provider API: plugin.js
The easiest way to satisfy these is to get orion-plugin.js, which is a minified file that includes both of them. Your plugin can then just include orion-plugin.js in a <script> tag, and you'll get everything you need.
Here are some existing plugins we've written. View the source code to see how they work:
- Contributes a "Beautify JS" button to the editor toolbar by using the editorAction service type.
- Contributes an "Uglify JS" button to the editor toolbar byusing the editorAction service type.
- Contributes several sample actions to the Orion navigator by using the fileCommands service type.
- Contributes syntax highlighting support for HTML files by using the ISyntaxHighlight service type.
- Orion/How Tos/Installing A Plugin Installing a plug-in
- eclipse.PluginProvider JSdoc