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

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

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

org.netbeans.editor.ext
Interface CompletionQuery


public interface CompletionQuery

Code completion querying SPI and support.


Nested Class Summary
static class CompletionQuery.AbstractResult
          The very basic funztionality of Result is implemented by this class, but parts general enough to not need to be overriden.
static class CompletionQuery.AbstractResultItem
          A class providing generic, nearly full implementation of ResultItem
static class CompletionQuery.DefaultResult
          Full implementation of Result, managing substitution of the text and finding and substituting common prefix of items
static class CompletionQuery.DefaultResultItem
           
static interface CompletionQuery.Result
          Result of the query or expression evaluation.
static interface CompletionQuery.ResultItem
          An interface used as an item of List returned by CompletionQuery.Result.getData() Such items are then able to their part in Completion process themselves
static interface CompletionQuery.ResultItemAssociatedObject
          An interface allowing to obtain the object carrying the actual data associated with the result item.
static interface CompletionQuery.SupportsSpeculativeInvocation
          Deprecated. It is a workaround. It's suggested that providers should wait for new completion query SPI that should better support speculative queries, partial results, result cancellation and result narrowing. Implement only if it's simple.
 
Method Summary
 CompletionQuery.Result query(JTextComponent component, int offset, SyntaxSupport support)
          Perform the query on the given component.
 

Method Detail

query

CompletionQuery.Result query(JTextComponent component,
                             int offset,
                             SyntaxSupport support)
Perform the query on the given component. The query usually gets the component's document, the caret position and searches back to find the last command start. Then it inspects the text up to the caret position and returns the result.

Implementations must be thread safe (also reentrant) because it can be called speculatively from multiple threads. This requirement can be removed in future SPI by passing additional flag marking speculative query. Skeletal implementation could handle multithreading based on the flag.

Parameters:
component - the component to use in this query.
offset - position in the component's document to which the query will be performed. Usually it's a caret position.
support - syntax-support that will be used during resolving of the query.
Returns:
result of the query or null if there's no result.

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.