Extends
Constructor
new ve.ui.CompletionWidget(surface, [config])
#
Hierarchy
Widget that displays autocompletion suggestions
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
surface |
ve.ui.Surface | Surface to complete into |
||||||||||||||||
config |
Object |
optional |
Configuration options Properties:
|
Widget that displays autocompletion suggestions
Methods
getCompletionRange([withSequence]) → {ve.Range|null
}
#
null
}
#
Get the range where the user has entered text in the document since opening the widget
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
withSequence |
boolean |
optional |
Include the triggering sequence text in the range |
Returns:
Range, null if not valid
- Type
-
ve.Range
|
null
Get the range where the user has entered text in the document since opening the widget
onMenuChoose(item)
#
Handle choose events from the menu
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.MenuOptionWidget | Chosen option |
Handle choose events from the menu
onMenuToggle(visible)
#
Handle toggle events from the menu
Parameters:
Name | Type | Description |
---|---|---|
visible |
boolean | Menu is visible |
Handle toggle events from the menu
onModelSelect(selection)
#
Handle select events from the document model
Parameters:
Name | Type | Description |
---|---|---|
selection |
ve.dm.Selection | Selection |
Handle select events from the document model
setup(action, [isolateInput])
#
Setup the completion widget
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
ve.ui.Action | Action which opened the widget |
|
isolateInput |
boolean |
optional |
Isolate input from the surface |
Setup the completion widget
teardown()
#
Teardown the completion widget
Teardown the completion widget
update()
#
Update the completion widget after the input has changed
Update the completion widget after the input has changed