Class orion.editor.ContentAssist
Provides content assist for a TextView.
Defined in: </shared/eclipse/e4/orion/I201404012230/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
orion.editor.ContentAssist(textView)
Creates a
ContentAssist for a TextView. |
Method Attributes | Method Name and Description |
---|---|
activate(providerInfoArray, 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.
|
|
dispatchEvent(evt)
Dispatches the given event to the listeners added to this event target.
|
|
filterProposals(event)
|
|
handleError(error)
|
|
isActive()
|
|
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.
|
|
setProviderInfoArray(providers)
Sets the array of content assist provider info that this ContentAssist will
consult to obtain proposals and automatic triggers.
|
|
setProviders(providers)
Sets the content assist providers that this ContentAssist will consult to obtain proposals.
|
|
setStyleAccessor(styleAccessor)
|
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.
|
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.
- Parameters:
- providerInfoArray
- autoTriggered
Defined in: </shared/eclipse/e4/orion/I201404012230/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.
- Parameters:
- {Object} proposal Optional
- Returns:
- {Boolean}
true
if the proposal was applied;false
if no proposal was provided.
Defined in: </shared/eclipse/e4/orion/I201404012230/bundles/org.eclipse.orion.client.editor/web/orion/editor/eventTarget.js>.
- Parameters:
- {Event} evt
- The event to dispatch.
- Parameters:
- event
- Returns:
- {orion.editor.TextView}
- Parameters:
- error
- Returns:
- {Boolean}
- Parameters:
- {orion.editor.ModelChangingEvent} event
- selectionEvent
- Returns:
- {Boolean}
true
if the event describes a change that should deactivate content assist.
All the parameters must be the same ones used to add the listener.
Defined in: </shared/eclipse/e4/orion/I201404012230/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.
- Parameters:
- {Boolean} enableAutoTrigger
- Parameters:
- {Object} editorContextProvider
- Parameters:
- mode
- Parameters:
- progress
- Parameters:
- {Array { provider: orion.editor.ContentAssistProvider|id: {String}|charTriggers: {RegExp}|excludedStyles: {RegExp} }} providers
- The providers.
- Parameters:
- {orion.editor.ContentAssistProvider[]} providers
- The providers.
- Parameters:
- styleAccessor
This event's data
field gives information
about the proposal that was applied.
This event's
data
field gives information about the proposals.