public abstract class SearchProvider extends Object
Example:
// use annotation to register this provider
@
ServiceProvider(service = SearchProvider.class)
public class ExampleSearchProvider extends SearchProvider {
// Create presenter
public Presenter createPresenter(boolean replaceMode) {
return new BasicSearchPresenter(replaceMode);
}
// Replacing is supported.
public boolean isReplaceSupported() {
return true;
}
// This search provider is always enabled.
public boolean isEnabled() {
return true; // could be disabled on some platforms
}
}
Modifier and Type | Class and Description |
---|---|
static class |
SearchProvider.Presenter
Presenter for search provider.
|
Modifier | Constructor and Description |
---|---|
protected |
SearchProvider()
Constructor for subclasses.
|
Modifier and Type | Method and Description |
---|---|
abstract SearchProvider.Presenter |
createPresenter(boolean replaceMode)
Create presenter for this search provider.
|
abstract String |
getTitle()
Get title to show in a tab of the search dialog.
|
abstract boolean |
isEnabled()
Tells whether this search provider is enabled.
|
abstract boolean |
isReplaceSupported()
If replace is supported, this dialog will be shown in replace dialog.
|
@NonNull public abstract SearchProvider.Presenter createPresenter(boolean replaceMode)
replaceMode
- True if the presenter will be used in Replace dialog,
false if it will be used in Find dialog.@NonNull public abstract String getTitle()
public abstract boolean isReplaceSupported()
public abstract boolean isEnabled()