Orion/Client API

Orion client API can roughly be divided into services and library objects. Services are obtained via a service registry, rather than instantiated by the client code. All interaction with services are asynchronous. If there is a return value to be obtained from the service, it is provided via a callback object passed in by the client.

Library objects are either stateless objects providing utility functions, or statefull objects that are instantiated directly by each client that needs one. Library objects never contain shared state that is available to multiple plugins or services.

Explorer Service

Tree model used by eclipse.ExplorerTree.Refer to TreeModel for API details.

File Service

eclipse.FileService

Provides operations on files, folders, and projects.Refer to FileService for API details.

Getting directory contents

Function

getChildren(parentItem, updateFunction)

Overview

Get all the files and sub-directories of a directory.

Parameters

Name

Type

Description

parentItem

Object

The given directory object , must have a "children" attribute

updateFunction

Function(Obj, Array)

Function to invoke after the server sends back the directory contents without errors. Obj is the directory object with its children field(Obj.children) filled up by the server JSON response . Array is the reference of the children.

Selection Service

User Service

Service for keeping track of the user. Refer to UserService for API details.

Library Objects

Editor

The following objects are related to the Orion rich text editor found in editor.js.

eclipse.Editor

A Editor is a user interface for editing text.

eclipse.DestroyEvent

This is the event sent when the editor is destroyed.

eclipse.LineStyleEvent

This is the event sent when the editor needs the style information for a line.

eclipse.ModelChangedEvent

This is the event sent when the text in the model has changed.

eclipse.ModelChangingEvent

This is the event sent when the text in the model is about to change.

eclipse.ModifyEvent

This is the event sent when the text is modified by the editor.

eclipse.Ruler

This interface represents a ruler for the editor.

eclipse.ScrollEvent

This is the event sent when the editor scrolls.

eclipse.Selection

A Selection represents a range of selected text in the editor.

eclipse.SelectionEvent

This is the event sent when the selection changes in the editor.

eclipse.Style

This object is used to define style information for the editor.

eclipse.StyleRange

This object is used to style range.

eclipse.TextModel

The TextModel is an interface that provides text for the editor.

eclipse.VerifyEvent

This is the event sent when the text is about to be modified by the editor.

Outliner

eclipse.Outliner

An Outliner provides an itemized overview of a resource and acts as a selection provider on that resource. Refer to Outliner for API details.

Search

eclipse.Searcher

Provides API for searching the workspace. Refer to Searcher for API details.

Service Registry

The service registry is somewhat unusual as a library object. Although a client can directly instantiate a private service registry and populate it with their own services, a registry is more typically passed into services and plug-ins upon construction. This avoids objects having to "reach out" and know who or what defines a given service.

The following objects are all related to the service registry:

eclipse.Plugin

A plugin is an object that is isolated in its own frame, and obtains and provides services via the asynchronous postMessage mechanism. Refer to Plugin for API details.

eclipse.Registry

The registry manages the set of available plugins. Refer to Registry for API details.

eclipse.Service

Represents a concrete service instance. Refer to Service for API details.

eclipse.ServiceProvider

A Service Provider is an object that implements a Service Type. Refer to ServiceProvider for API details.

eclipse.ServiceReference

A ServiceReference enables services to be called and released. Refer to ServiceReference for API details.

Table tree

Generates an HTML table where one of the columns is indented according to depth of children. Refer to TableTree for API details.

Constructing A Table Tree

Function

TableTree (options)

Overview

Generates an HTML table where one of the columns is indented according to depth of children.

Parameters

Name

Type

Description

options.model

Object

Model that generates children items. The model must implement:getRoot(onItem) to provide the root of the model getChildren(parentItem, onComplete) to provide children items by a given parent itemgetId(item) to provide id of a given item ,which must be a valid DOM id

options.renderer

Object

Renderer that generates the HTML table row for each child. The renderer must implement:initTable(tableNode)to set up table attributes and a header if desiredrender(item, tr) to generate tds for the rowlabelColumnIndex() to provide 0 based index of which td contains the primary label which will be indented

A renderer can be supplied which generates the HTML table row for each child. Custom rendering allows clients to use checkboxes, images, links, etc. to describe each element in the tree. Renderers handle all clicks and other behavior via their supplied row content.