| explain = This service uses [[EclipseWeb/Server_API#Getting_directory_metadata|server directory service]].As shown in the example above , this service user uses the children to do something by the function onComplete. '''See also''' [[EclipseWeb/Architecture#Services|service registry]].

+

| explain = This service uses [[Orion/Server_API#Getting_directory_metadata|server directory service]].As shown in the example above , this service user uses the children to do something by the function onComplete. '''See also''' [[Orion/Architecture#Services|service registry]].

}}

}}

Line 66:

Line 66:

{{Orion/ClientAPI

{{Orion/ClientAPI

| function = createWorkspace(name, onCreate)

| function = createWorkspace(name, onCreate)

−

| overview = Creates a new workspace with the given name , using [[EclipseWeb/Server_API#Workspace_Service|server workspace service]]

+

| overview = Creates a new workspace with the given name , using [[Orion/Server_API#Workspace_Service|server workspace service]]

| parameters =

| parameters =

−

{{EclipseWeb/ParamHead

+

{{Orion/ParamHead

| Rows =

| Rows =

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = name

| Name = name

| Type= string

| Type= string

Line 77:

Line 77:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = onCreate

| Name = onCreate

| Type= Function

| Type= Function

Line 96:

Line 96:

| overview = Loads the workspace with the given id and sets it to be the current workspace.

| overview = Loads the workspace with the given id and sets it to be the current workspace.

| explain = This service uses [[EclipseWeb/Server_API/File_API#Creating_a_directory|server directory creation]]. As shown in the example above , the service user uses the baseItem to call the [[EclipseWeb/Client_API#Getting_directory_contents| Getting directorycontents]] to render the new folder , with its siblings. '''See also''' [[EclipseWeb/Architecture#Services|service registry]].

+

| explain = This service uses [[Orion/Server_API/File_API#Creating_a_directory|server directory creation]]. As shown in the example above , the service user uses the baseItem to call the [[Orion/Client_API#Getting_directory_contents| Getting directorycontents]] to render the new folder , with its siblings. '''See also''' [[Orion/Architecture#Services|service registry]].

}}

}}

Line 156:

Line 156:

{{Orion/ClientAPI

{{Orion/ClientAPI

| function = createFile(fileName, baseItem, updateFunction)

| function = createFile(fileName, baseItem, updateFunction)

−

| overview = Creates a file by given name under a base folder. '''See also''' [[EclipseWeb/Client_API#Creating_folder|folder creation]]

+

| overview = Creates a file by given name under a base folder. '''See also''' [[Orion/Client_API#Creating_folder|folder creation]]

| explain = This service uses [[EclipseWeb/Server_API/File_API#Creating_an_empty_file|server file creation]]. As shown in the example above , the service user uses the baseItem to call the [[EclipseWeb/Client_API#Getting_directory_contents| Getting directory contents]] to render the new file , with its siblings. '''See also''' [[EclipseWeb/Architecture#Services|service registry]].

+

| explain = This service uses [[Orion/Server_API/File_API#Creating_an_empty_file|server file creation]]. As shown in the example above , the service user uses the baseItem to call the [[Orion/Client_API#Getting_directory_contents| Getting directory contents]] to render the new file , with its siblings. '''See also''' [[Orion/Architecture#Services|service registry]].

| explain = This service uses [[EclipseWeb/Server_API/File_API#Deleting_a_file_or_directory|server file deletion]]. As shown in the example above , the service user uses the item to call the [[EclipseWeb/Client_API#Getting_directory_contents| Getting directory contents]] to render the item's parent in order to remove the file or folder visually. '''See also''' [[EclipseWeb/Architecture#Services|service registry]].

+

| explain = This service uses [[Orion/Server_API/File_API#Deleting_a_file_or_directory|server file deletion]]. As shown in the example above , the service user uses the item to call the [[Orion/Client_API#Getting_directory_contents| Getting directory contents]] to render the item's parent in order to remove the file or folder visually. '''See also''' [[Orion/Architecture#Services|service registry]].

}}

}}

Line 241:

Line 241:

| overview = Retrieves the preference with the given key.

| overview = Retrieves the preference with the given key.

| parameters =

| parameters =

−

{{EclipseWeb/ParamHead

+

{{Orion/ParamHead

| Rows =

| Rows =

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = key

| Name = key

| Type= String

| Type= String

Line 250:

Line 250:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = onDone

| Name = onDone

| Type= Function(pref)

| Type= Function(pref)

Line 269:

Line 269:

}]);

}]);

−

| explain = This service uses [[EclipseWeb/Server_API#Preference_API|server preference API]]. As shown in the example above , the service user uses the prefs as JSON data . '''See also''' [[EclipseWeb/Architecture#Services|service registry]].

+

| explain = This service uses [[Orion/Server_API#Preference_API|server preference API]]. As shown in the example above , the service user uses the prefs as JSON data . '''See also''' [[Orion/Architecture#Services|service registry]].

}}

}}

Line 277:

Line 277:

| overview =Sets the preference with the given key to the provided value.

| overview =Sets the preference with the given key to the provided value.

| overview = Registers a local service implementation in the service registry.

| overview = Registers a local service implementation in the service registry.

| parameters =

| parameters =

−

{{EclipseWeb/ParamHead

+

{{Orion/ParamHead

| Rows =

| Rows =

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = serviceType

| Name = serviceType

| Type= String

| Type= String

Line 386:

Line 386:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = id

| Name = id

| Type= String

| Type= String

Line 392:

Line 392:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = serviceImpl

| Name = serviceImpl

| Type= Object

| Type= Object

Line 398:

Line 398:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = properties

| Name = properties

| Type= Object

| Type= Object

Line 417:

Line 417:

| overview = Registers a local service implementation in the service registry.

| overview = Registers a local service implementation in the service registry.

| parameters =

| parameters =

−

{{EclipseWeb/ParamHead

+

{{Orion/ParamHead

| Rows =

| Rows =

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = serviceType

| Name = serviceType

| Type= String

| Type= String

−

| Desc= The type of the service. '''Refer to''' serviceType in [[EclipseWeb/Client_API#Registering_a_local_service|service registration]].

+

| Desc= The type of the service. '''Refer to''' serviceType in [[Orion/Client_API#Registering_a_local_service|service registration]].

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = methodName

| Name = methodName

| Type= String

| Type= String

Line 432:

Line 432:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = callback

| Name = callback

| Type= Function(result)

| Type= Function(result)

Line 438:

Line 438:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = params

| Name = params

| Type= Array

| Type= Array

Line 444:

Line 444:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = instanceId

| Name = instanceId

| Type= String

| Type= String

−

| Desc= Optional. The id of the service implementation registered as serviceType. '''Refer to''' id in [[EclipseWeb/Client_API#Registering_a_local_service|service registration]]. If id is not defined the first service implementation of serviceType is used.

+

| Desc= Optional. The id of the service implementation registered as serviceType. '''Refer to''' id in [[Orion/Client_API#Registering_a_local_service|service registration]]. If id is not defined the first service implementation of serviceType is used.

}}

}}

}}

}}

Line 469:

Line 469:

| parameters =

| parameters =

−

{{EclipseWeb/ParamHead

+

{{Orion/ParamHead

| Rows =

| Rows =

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = options.model

| Name = options.model

| Type= Object

| Type= Object

Line 478:

Line 478:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = options.renderer

| Name = options.renderer

| Type= Object

| Type= Object

Line 484:

Line 484:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = options.showRoot

| Name = options.showRoot

| Type= Boolean

| Type= Boolean

Line 490:

Line 490:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = options.indent

| Name = options.indent

| Type= int

| Type= int

Line 496:

Line 496:

}}

}}

−

{{EclipseWeb/ParamBody

+

{{Orion/ParamBody

| Name = options.id

| Name = options.id

| Type= String

| Type= String

Revision as of 16:36, 10 January 2011

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.

Services

Command Service

A command is an object that describes an action a user can perform, as well as when and what it should look like when presented in various contexts.

eclipse.KeyBinding

A KeyBinding represents of a key code and a modifier state that can be triggered by the user using the keyboard.

Dialog Service

eclipse.DialogService

Common dialog services

Explorer Service

eclipse.Explorer

A table-based explorer component

eclipse.Model

Tree model used by eclipse.Explorer.

eclipse.TreeModel

Tree model used by eclipse.ExplorerTree.

File Service

eclipse.FileService

Provides operations on files, folders, and projects.

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

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.

Search

eclipse.Searcher

Provides API for searching the workspace.

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.

Table tree

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

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.