Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/How Tos/Installing A Plugin"
m (wording) |
m (→Using installed functionality) |
||
Line 33: | Line 33: | ||
*From the Navigator page, create a new JavaScript file called '''test.js'''. | *From the Navigator page, create a new JavaScript file called '''test.js'''. | ||
*Click on '''test.js''' to open it in the Orion code editor. | *Click on '''test.js''' to open it in the Orion code editor. | ||
− | *Type | + | *Type or copy/paste some JavaScript code into the editor (preferably some code with messy formatting). |
− | *Look at the editor toolbar. You'll see a new command available called "Format JS". This command was contributed by the jsbeautify plugin we installed earlier. Commands | + | *Look at the editor toolbar. You'll see a new command available called "Format JS". This command was contributed by the jsbeautify plugin we installed earlier. Commands can also define a key binding that activates the command. (You can see a list of available key bindings by pressing Ctrl+Shift+L while on the editor page, or "?" on any other page.) A contributed [[Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.command|editor command]] has access to the selected text in the editor, the complete editor buffer, and information about the current selection. As a result of invoking a command, the command can replace the current selection with a new text, change the complete editor buffer, and/or change the selection.<br /> |
[[Image:Orion-plugin-action.png]] | [[Image:Orion-plugin-action.png]] | ||
− | * Select your code, click "Format JS", and it will be formatted for you. | + | *Select your code, click "Format JS", and it will be formatted for you. |
− | + | ||
+ | See the [[Orion/Documentation/Developer_Guide|Developer Guide]] for a list of places where new functionality can be contributed to Orion. If you have ideas for an extension but need more or different API to implement it, please [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=e4&component=Orion file a bug]. | ||
[[Category:Orion]] | [[Category:Orion]] | ||
[[Category:Orion/How To]] | [[Category:Orion/How To]] |
Revision as of 20:01, 17 June 2011
This page explains how an end-user can install third-party functionality so that it is available to the Orion editor.
Install using Registry Page
- If your server runs on orionhub.org, go to http://www.orionhub.org/plugin/list.html.
- If your server runs on localhost, go to http://localhost:8080/plugin/list.html.
- This page shows all installed plugins. You'll see several plugins in the list already. These contribute some basic Orion functionality (for example, file support, Git, and JSLint).
- Enter a plugin URL into the text field. For example, enter http://jsbeautifier.org/orion/0.2/jsbeautify.html to install JavaScript code formatting functionality. Click "Install".
- You should see a success message, and the the tree will refresh. It should now contain the new plugin.
- The plugins are currently installed using local storage, which means that they are only active in one browser.
To remove an installed plugin:
- Select its URL in the tree.
- Click the Copy Location button to copy its URL into the text box.
- Click Uninstall, then OK to the prompt.
- The plugin should disappear from the list.
Using installed functionality
Installed plugins may contribute functionality to Orion in a number of different ways, not all of which are immediately visible in the UI.
Continuing from where the previous example left off:
- From the Navigator page, create a new JavaScript file called test.js.
- Click on test.js to open it in the Orion code editor.
- Type or copy/paste some JavaScript code into the editor (preferably some code with messy formatting).
- Look at the editor toolbar. You'll see a new command available called "Format JS". This command was contributed by the jsbeautify plugin we installed earlier. Commands can also define a key binding that activates the command. (You can see a list of available key bindings by pressing Ctrl+Shift+L while on the editor page, or "?" on any other page.) A contributed editor command has access to the selected text in the editor, the complete editor buffer, and information about the current selection. As a result of invoking a command, the command can replace the current selection with a new text, change the complete editor buffer, and/or change the selection.
- Select your code, click "Format JS", and it will be formatted for you.
See the Developer Guide for a list of places where new functionality can be contributed to Orion. If you have ideas for an extension but need more or different API to implement it, please file a bug.