nsIAutoCompleteInput 编辑
toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl
Scriptable This interface monitors the input in a text field and displays an autocomplete panel at the appropriate time. Inherits from: nsISupports
Last changed in Gecko 1.9 (Firefox 3)Method overview
ACString getSearchAt(in unsigned long index); |
void onSearchBegin(); |
void onSearchComplete(); |
boolean onTextEntered(); |
boolean onTextReverted(); |
void selectTextRange(in long startIndex, in long endIndex); |
Attributes
Attribute | Type | Description |
completeDefaultIndex | boolean | If a search result has its defaultIndex set, this will optionally try to complete the text in the textbox to the entire text of the result at the default index as the user types. This means that auto-fill is enabled. |
completeSelectedIndex | boolean | If true , the text in the text field will be autocompleted as the user selects from the popup list. |
consumeRollupEvent | boolean | If true , the event that rolls up the popup should be consumed by the popup itself. If false , the rollup event will be dispatched. Read only. |
controller |
| The controller. Read only. |
disableAutoComplete | boolean | true if auto-complete is currently disabled; otherwise false . |
forceComplete | boolean | If true , the text field automatically completes to the default result whenever the user hits the enter key or the text field loses focus. |
maxRows | unsigned long | The maximum number of rows to display in the autocomplete suggestion popup. |
minResultsForPopup | unsigned long | Specifies a minimum number of search results that must be available before the autocomplete popup will open. |
popup |
| The view in which results will be displayed.Read only. |
popupOpen | boolean | Indicates whether or not the popup view is already open. |
searchCount | unsigned long | The number of autocomplete sessions to search. Read only. |
searchParam | AString | An additional parameter used for configuring searches. |
selectionEnd | long | The ending index of the current selection in the text field. Read only. |
selectionStart | long | The starting index of the current selection in the text field. Read only. |
showCommentColumn | boolean | If true , a column is added to the popup, showing the comment for each autocomplete result. |
showImageColumn | boolean | If true , a column is added to the popup, showing an additional image for each autocomplete result. |
textValue | AString | The value of the text in the autocomplete text field. |
timeout | unsigned long | The number of milliseconds after a keystroke before a search begins. |
Methods
getSearchAt()
Returns the name of one of the autocomplete search session objects.
ACString getSearchAt( in unsigned long index );
Parameters
index
- The index number of the search session object whose name is to be returned.
Return value
The name of the specified object.
onSearchBegin()
Called when the search starts.
void onSearchBegin();
Parameters
None.
onSearchComplete()
Called when the search ends successfully.
void onSearchComplete();
Parameters
None.
onTextEntered()
Called when the user selects and presses enter on a result item.
boolean onTextEntered();
Parameters
None.
Return value
Return true
to prevent handling the selection.
onTextReverted()
Called when the user cancels the autocomplete session.
boolean onTextReverted();
Parameters
None.
Return value
Return true
to prevent the reversion.
selectTextRange()
Selects a range of text in the autocomplete text field.
void selectTextRange( in long startIndex, in long endIndex );
Parameters
startIndex
- The index to the first character in the text field to select.
endIndex
- The index to the last character in the text field to select.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论