站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

CompletionQuery.Result (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor.ext
Interface CompletionQuery.Result

All Known Implementing Classes:
CompletionQuery.AbstractResult, CompletionQuery.DefaultResult
Enclosing interface:
CompletionQuery

public static interface CompletionQuery.Result

Result of the query or expression evaluation. Simply said it consists of the list of the data and title and an internal information about how to substitute the text.


Method Summary
 List getData()
          Get the list with the items satisfying the query.
 String getTitle()
          Get the title describing the result or null if there's no title.
 boolean substituteCommonText(int dataIndex)
          Substitute the text that is common for all the data entries.
 boolean substituteText(int dataIndex, boolean shift)
          Substitute the text in the document if the user picks the item from the data with the given index either by pressing ENTER or doubleclicking the item by mouse.
 

Method Detail

getData

List getData()
Get the list with the items satisfying the query. The list must always be non-null. If there are no data it will have a zero size.

Returns:
List of objects implementing ResultItem.

getTitle

String getTitle()
Get the title describing the result or null if there's no title.


substituteText

boolean substituteText(int dataIndex,
                       boolean shift)
Substitute the text in the document if the user picks the item from the data with the given index either by pressing ENTER or doubleclicking the item by mouse.

Parameters:
dataIndex - current selected item index in the current data list. It can be used for making the substitution.
shift - indicates request for some kind of different behaviour, means that e.g. user hold shift while pressing ENTER.
Returns:
whether the text was substituted or not

substituteCommonText

boolean substituteCommonText(int dataIndex)
Substitute the text that is common for all the data entries. This is used to update the document with the common text when the user presses the TAB key.

Parameters:
dataIndex - current selected item index in the current data list. Although normally it shouldn't be necessary for making the substitution, the completion implementations can use it for customized behavior.
Returns:
whether the text was substituted or not

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.