public final class AsyncCompletionTask extends Object implements CompletionTask, Runnable
AsyncCompletionQuery
.
AsyncCompletionQuery
that must
be passed to constructor of this task.AsyncCompletionQuery
Constructor and Description |
---|
AsyncCompletionTask(AsyncCompletionQuery query)
Constructor for the case when there is no valid component
which can happen when creating task for documentation or tooltip computation.
|
AsyncCompletionTask(AsyncCompletionQuery query,
JTextComponent component)
Construct asynchronous task for the given component.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Called by completion infrastructure to cancel the running task.
|
void |
query(CompletionResultSet resultSet)
Called by completion infrastructure in AWT thread to populate
the given result set with data.
|
void |
refresh(CompletionResultSet resultSet)
Called by completion infrastructure in AWT thread once there
is a change in the component (caret position changes or document
gets modified).
|
void |
run()
This method will be run() from the RequestProcessor during
performing of the query.
|
String |
toString() |
public AsyncCompletionTask(AsyncCompletionQuery query, JTextComponent component)
query
- non-null query implementation.component
- text component to operate with. The completion infrastructure
will cancel the task if the component or its associated document would change.
public AsyncCompletionTask(AsyncCompletionQuery query)
query
- non-null query implementation.public void query(CompletionResultSet resultSet)
query
in interface CompletionTask
resultSet
- non-null result set to which the results
of the query must be added.public void refresh(CompletionResultSet resultSet)
refresh
in interface CompletionTask
resultSet
- non-null result set to which the results
of the refreshing must be added.
query()
was not invoked yet and user has typed a character. In this case
the provider may hide the completion
by using Completion.get().hideAll()
if the typed character is inappropriate e.g. ";" for java completion.public void cancel()
cancel
in interface CompletionTask
public void run()