Class Index | File Index

Classes


Class orion.editor.ContentAssist

Provides content assist for a TextView.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a ContentAssist for a TextView.
Method Summary
Method Attributes Method Name and Description
 
activate(providers, autoTriggered)
 
addEventListener(type, listener, useCapture)
Adds an event listener to this event target.
 
apply(proposal)
Applies the given proposal to the TextView.
 
 
Computes the proposals at the TextView's current caret offset.
 
 
Dispatches the given event to the listeners added to this event target.
 
 
 
 
handleError(error)
 
Initializes the providers.
 
 
isDeactivatingChange(event, selectionEvent)
 
removeEventListener(type, listener, useCapture)
Removes an event listener from the event target.
 
setAutoTriggerEnabled(enableAutoTrigger)
Sets whether or not automatic content assist triggering is enabled.
 
setEditorContextProvider(editorContextProvider)
Sets the provider that will be invoked to generate the Editor Context service and options to any content assist providers that implement the v4.0 content assist API.
 
setMode(mode)
 
setProgress(progress)
Sets the progress handler that will display progress information, if any are generated by content assist providers.
 
setProviders(providers)
Sets the content assist providers that this ContentAssist will consult to obtain proposals.
 
setStyleAccessor(styleAccessor)
Event Summary
Event Attributes Event Name and Description
 
Dispatched when a ContentAssist is about to be activated.
 
Dispatched when a ContentAssist is about to be deactivated.
 
Dispatched when a ContentAssist has applied a proposal.
 
Dispatched whenever a ContentAssist has obtained proposals from its providers.
Class Detail
orion.editor.ContentAssist(textView)
Creates a ContentAssist for a TextView. A ContentAssist consults a set of orion.editor.ContentAssistProviders to obtain proposals for text that may be inserted into a TextView at a given offset.

A ContentAssist is generally activated by its TextView action, at which point it computes the set of proposals available. It will re-compute the proposals in response to subsequent changes on the TextView (for example, user typing) for as long as the ContentAssist is active. A proposal may be applied by calling #apply, after which the ContentAssist becomes deactivated. An active ContentAssist may be deactivated by calling #deactivate.

A ContentAssist dispatches events when it becomes activated or deactivated, and when proposals have been computed.

Parameters:
{orion.editor.TextView} textView
The TextView to provide content assist for.
Method Detail
activate(providers, autoTriggered)
Parameters:
providers
autoTriggered

addEventListener(type, listener, useCapture)
Adds an event listener to this event target.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/eventTarget.js>.
Parameters:
{String} type
The event type.
{Function|EventListener} listener
The function or the EventListener that will be executed when the event happens.
{Boolean} useCapture Optional, Default: false
true if the listener should be trigged in the capture phase.
See:
orion.editor.EventTarget#removeEventListener

{Boolean} apply(proposal)
Applies the given proposal to the TextView.
Parameters:
{Object} proposal Optional
Returns:
{Boolean} true if the proposal was applied; false if no proposal was provided.

clearProviders()

computeProposals()
Computes the proposals at the TextView's current caret offset.

deactivate()

dispatchEvent(evt)
Dispatches the given event to the listeners added to this event target.
Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/eventTarget.js>.
Parameters:
{Event} evt
The event to dispatch.

filterProposals(force)
Parameters:
force

getProviders()
Returns:
orion.edit.ContentAssistProviderInfo[]

{orion.editor.TextView} getTextView()
Returns:
{orion.editor.TextView}

handleError(error)
Parameters:
error

initialize()
Initializes the providers. A provider must define an initialize() method to be initialized.
Since:
6.0

{Boolean} isActive()
Returns:
{Boolean}

{Boolean} isDeactivatingChange(event, selectionEvent)
Parameters:
{orion.editor.ModelChangingEvent} event
selectionEvent
Returns:
{Boolean} true if the event describes a change that should deactivate content assist.

removeEventListener(type, listener, useCapture)
Removes an event listener from the event target.

All the parameters must be the same ones used to add the listener.


Defined in: </jobs/genie.orion/orion-client-stable/workspace/bundles/org.eclipse.orion.client.editor/web/orion/editor/eventTarget.js>.
Parameters:
{String} type
The event type
{Function|EventListener} listener
The function or the EventListener that will be executed when the event happens.
{Boolean} useCapture Optional, Default: false
true if the listener should be trigged in the capture phase.
See:
orion.editor.EventTarget#addEventListener

setAutoTriggerEnabled(enableAutoTrigger)
Sets whether or not automatic content assist triggering is enabled.
Parameters:
{Boolean} enableAutoTrigger

setEditorContextProvider(editorContextProvider)
Sets the provider that will be invoked to generate the Editor Context service and options to any content assist providers that implement the v4.0 content assist API.
Parameters:
{Object} editorContextProvider

setMode(mode)
Parameters:
mode

setProgress(progress)
Sets the progress handler that will display progress information, if any are generated by content assist providers.
Parameters:
progress

setProviders(providers)
Sets the content assist providers that this ContentAssist will consult to obtain proposals.
Parameters:
{orion.editor.ContentAssistProvider[]|orion.edit.ContentAssistProviderInfo[]} providers
The providers. Each element may be either a plain orion.editor.ContentAssistProvider, or a orion.edit.ContentAssistProviderInfo.

setStyleAccessor(styleAccessor)
Parameters:
styleAccessor
Event Detail
ActivatingEvent()
Dispatched when a ContentAssist is about to be activated.

DeactivatingEvent()
Dispatched when a ContentAssist is about to be deactivated.

ProposalAppliedEvent()
Dispatched when a ContentAssist has applied a proposal.

This event's data field gives information about the proposal that was applied.


ProposalsComputedEvent()
Dispatched whenever a ContentAssist has obtained proposals from its providers.

This event's data field gives information about the proposals.


Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 17 2017 08:51:35 GMT-0400 (EDT)