* The built editor files will also be available directly from the Orion editor web page [http://eclipse.org/orion/editor/releases releases section].

+

* The built editor files will also be available directly from the Orion editor web page [http://eclipse.org/orion/editor/releases releases section]. (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=427409 Bug 427409])

= Using the Build =

= Using the Build =

+

+

The next sections will show the simplest way to embed an editor by using the orion/editor/edit function. Note if you want customize your editor (beyond the options provided by the edit function), you have access to the full editor in the build.

The following demos are going to start with the following html file then add in the built editor:

The following demos are going to start with the following html file then add in the built editor:

Here is the current list of attributes supported by the build for the 2.0 release. Note that these are liable to change in future releases.

+

Below is the current list of options(along with their default values) supported in the 4.0 release. The options can be specified directly in HTML by adding data attributes prefixed with "data-editor". Since HTML attributes are case insensitive, camel case letters are prefixed by a dash. For example: fullSelection becomes full-selection.

Orion Editor web page

Using the Build

The next sections will show the simplest way to embed an editor by using the orion/editor/edit function. Note if you want customize your editor (beyond the options provided by the edit function), you have access to the full editor in the build.

The following demos are going to start with the following html file then add in the built editor:

Using the standalone build

These instructions are going to use the builds available on eclipse.org/orion.editor. If you have downloaded the built-editor.min.js and built-editor.css files to your local server, just update the corresponding paths.

Using the RequireJS build

These instructions are going to use the builds available on eclipse.org/orion.editor. If you have downloaded the built-editor-amd.min.js and built-editor.css files to your local server, just update the corresponding paths.

Editor Options

Below is the current list of options(along with their default values) supported in the 4.0 release. The options can be specified directly in HTML by adding data attributes prefixed with "data-editor". Since HTML attributes are case insensitive, camel case letters are prefixed by a dash. For example: fullSelection becomes full-selection.

/**
* @class This object describes the options for <code>edit</code>.
* @name orion.editor.EditOptions
*
* @property {String|DOMElement} parent the parent element for the view, it can be either a DOM element or an ID for a DOM element.
* @property {Boolean} [readonly=false] whether or not the view is read-only.
* @property {Boolean} [fullSelection=true] whether or not the view is in full selection mode.
* @property {Boolean} [tabMode=true] whether or not the tab keypress is consumed by the view or is used for focus traversal.
* @property {Boolean} [expandTab=false] whether or not the tab key inserts white spaces.
* @property {String} [themeClass] the CSS class for the view theming.
* @property {Number} [tabSize=4] The number of spaces in a tab.
* @property {Boolean} [wrapMode=false] whether or not the view wraps lines.
* @property {Function} [statusReporter] a status reporter.
* @property {String} [title=""] the editor title.
* @property {String} [contents=""] the editor contents.
* @property {String} [lang] the styler language. Plain text by default.
* @property {Boolean} [showLinesRuler=true] whether or not the lines ruler is shown.
* @property {Boolean} [showAnnotationRuler=true] whether or not the annotation ruler is shown.
* @property {Boolean} [showOverviewRuler=true] whether or not the overview ruler is shown.
* @property {Boolean} [showFoldingRuler=true] whether or not the folding ruler is shown.
*/