org.das2.jythoncompletion.support.CompletionProvider
The basic interface of the code completion querying SPI. Various implementations can
be registered per a document mime-type.
COMPLETION_QUERY_TYPE
The int
value representing the query for a code completion.
DOCUMENTATION_QUERY_TYPE
The int
value representing the query for a documentation.
TOOLTIP_QUERY_TYPE
The int
value representing the query for a tooltip hint.
COMPLETION_ALL_QUERY_TYPE
The int
value representing the query for an all code completion.
createTask
createTask( int queryType, javax.swing.text.JTextComponent component ) → org.das2.jythoncompletion.support.CompletionTask
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 {@link org.netbeans.spi.editor.completion.support.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 {@link #COMPLETION_QUERY_TYPE},
{@link #COMPLETION_ALL_QUERY_TYPE}, {@link #DOCUMENTATION_QUERY_TYPE},
or {@link #TOOLTIP_QUERY_TYPE} (but not their combination).
component - a component on which the query is performed
Returns:
a task performing the query.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getAutoQueryTypes
getAutoQueryTypes( javax.swing.text.JTextComponent component, String typedText ) → int
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 {@link #createTask(int, JTextComponent)}.
Parameters
component - a component in which typing appeared
typedText - a typed text
Returns:
a combination of the {@link #COMPLETION_QUERY_TYPE}, {@link #COMPLETION_ALL_QUERY_TYPE},
{@link #DOCUMENTATION_QUERY_TYPE}, and {@link #TOOLTIP_QUERY_TYPE}
values, or zero if no query should be automatically invoked.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]