public interface TypeProvider
Modifier and Type | Interface and Description |
---|---|
static class |
TypeProvider.Context
Represents search context.
|
static class |
TypeProvider.Result
Represents a collection of TypeDescriptors that match
the given search criteria.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the current operation, if possible.
|
void |
cleanup()
The Go To Type dialog is dismissed for now - free up resources if applicable.
|
void |
computeTypeNames(TypeProvider.Context context,
TypeProvider.Result result)
Compute a list of TypeDescriptors that match the given search text for the given
search type.
|
String |
getDisplayName()
Describe this provider for the user, in case we want to offer filtering
capabilities in the Go To Type dialog
|
String |
name()
Describe this provider with an internal name, in case we want to provide
some kind of programmatic filtering (e.g.
|
String name()
String getDisplayName()
void computeTypeNames(TypeProvider.Context context, TypeProvider.Result result)
TypeProvider.cancel()
on the same type provider during the operation, in which
case the method can return incomplete results. If there is a "current project",
the Go To Type infrastructure will perform the search in two passes; first it
will call TypeDescriptor.getTypeName()
with the current project, which should be a reasonably
fast search, and display those types first. It will then call the method again
with a null project, which should return all types.
Note that a useful performance optimization is for the TypeProvider to cache
a few of its most recent search results, and if the next search (e.g. more user
keystrokes) is a simple narrowing of the search, just filter the previous search
result. There is an explicit TypeProvider.cleanup()
call that the Go To Type dialog
will make at the end of the dialog interaction, which can be used to clean up the cache.
context
- search context containg search text and type, optionally projectresult
- filled with type descriptors and optional messagevoid cancel()
void cleanup()