Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.modules.editor.completion/1 1.6.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.spi.editor.completion
Interface CompletionProvider

    public interface CompletionProvider

The basic interface of the code completion querying SPI. Various implementations can be registered per a document mime-type.

Field Summary
`static int` | `COMPLETION_QUERY_TYPE` The `int` value representing the query for a code completion.
`static int` | `DOCUMENTATION_QUERY_TYPE` The `int` value representing the query for a documentation.
`static int` | `TOOLTIP_QUERY_TYPE` The `int` value representing the query for a tooltip hint.

Method Summary
`CompletionTask` | `createTask(int queryType, JTextComponent component)` Creates a task that performs a query of the given type on the given component.
`int` | `getAutoQueryTypes(JTextComponent component, String typedText)` Called by the code completion infrastructure to check whether a text just typed into a text component triggers an automatic query invocation.

Field Detail

### COMPLETION_QUERY_TYPE

    static final int COMPLETION_QUERY_TYPE

  The `int` value representing the query for a code completion.

  See Also:
    Constant Field Values

### DOCUMENTATION_QUERY_TYPE

    static final int DOCUMENTATION_QUERY_TYPE

  The `int` value representing the query for a documentation.

  See Also:
    Constant Field Values

### TOOLTIP_QUERY_TYPE

    static final int TOOLTIP_QUERY_TYPE

  The `int` value representing the query for a tooltip hint.

  See Also:
    Constant Field Values

Method Detail

### createTask

    CompletionTask createTask(int queryType,
                              JTextComponent component)

  Creates a task that performs a query of the given type on the given component.
  This method is invoked in AWT thread only and the returned task may either be synchronous (if it's not complex) or it may be asynchonous (see `AsyncCompletionTask`).
  The task usually inspects the component's document, the text up to the caret position and returns the appropriate result.

  Parameters:
    `queryType` - a type ot the query. It can be one of the `COMPLETION_QUERY_TYPE`, `DOCUMENTATION_QUERY_TYPE`, or `TOOLTIP_QUERY_TYPE` (but not their combination).
    `component` - a component on which the query is performed
  Returns:
    a task performing the query.

### getAutoQueryTypes

    int getAutoQueryTypes(JTextComponent component,
                          String typedText)

  Called by the code completion infrastructure to check whether a text just typed into a text component triggers an automatic query invocation.
  If the particular query type is returned the infrastructure will then call `createTask(int, JTextComponent)`.

  Parameters:
    `component` - a component in which typing appeared
    `typedText` - a typed text
  Returns:
    a combination of the `COMPLETION_QUERY_TYPE`, `DOCUMENTATION_QUERY_TYPE`, and `TOOLTIP_QUERY_TYPE` values, or zero if no query should be automatically invoked.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.modules.editor.completion/1 1.6.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.