| orion.edit.occurrences | ||
|---|---|---|
|
|
|
| orion.edit.model | orion.edit.outliner | |
The orion.edit.occurrences service allows plugins to compute identifier occurrences for specific
content types.
Implementations of orion.edit.occurrences must define the following function:
orion.edit.EditorContext object that contains all of the information about the current editor.
The return value (or fulfillment value) is an Array of top-level occurrence objects, which will be automatically marked in the editor.
Each occurrence object has these properties:
Number The offset into the file for the start of the occurrenceNumber The offset into the file for the end of the occurrenceImplementations of orion.edit.occurrences may define the following attributes:
String[] An array of
Content Type IDs for which this occurrence computer is valid.
String A string to create a regular expression to determine if this occurrence service applies to the current context. This attribute has been deprecated in favor of contentType.
The following example is how Orion plugs in occurrence support for JavaScript:
var provider = new orion.PluginProvider();
provider.registerService('orion.edit.occurrences',
{
computeOccurrences: function(editorContext, context) {
return [];
}
{
contentType: ["application/javascript"]
});
provider.connect();
|
|
|
| orion.edit.model | orion.edit.outliner |