public abstract class Findable extends Object
getFindable())
to support textual searching inside the viewer.
The following example shows how to create a Findable as an anonymous inner class. Note that this code comes from the example in
DocumentViewerFactory and assumes that there is a global String variable called residues.
new Findable(){
public boolean find(FindOptions options){
//normaly there would be code in here to select the region that matches the search
//but since this viewer does not select, it sufficient to simply state whether a
//match was found or not.
return residues.contains(options.getText().toUpperCase());
}
};
| Modifier and Type | Class and Description |
|---|---|
static class |
Findable.FindOptions
User options for a search.
|
| Constructor and Description |
|---|
Findable() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canFindAll()
Returns true if this Findable supports doing a "Find All" search.
|
abstract boolean |
find(Findable.FindOptions options)
Performs a find using the given options.
|
boolean |
find(Findable.FindOptions options,
ProgressListener progressListener)
A Findable implementation may optionally implement this variation of
find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions)
if it may take a noticable amount of time to perform the search. |
Options |
getAdditionalOptions(Callable<String> currentSearchTextGetter)
A sub-class can optionally override this to replace the standard isCaseSensitive
with some custom options.
|
public abstract boolean find(Findable.FindOptions options)
find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions, jebl.util.ProgressListener) instead.options - to usepublic boolean find(Findable.FindOptions options, ProgressListener progressListener)
find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions)
if it may take a noticable amount of time to perform the search.
Unlike find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions) which is always invoked in the swing thread,
this method is always invoked outside of the swing thread.
The default implementation of this method calls find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions) from
the swing thread and does not return until find(com.biomatters.geneious.publicapi.plugin.Findable.FindOptions) returns.options - the options to use when searchingprogressListener - for optionally reporting progress and checking if the user wishes to cancel the searchpublic Options getAdditionalOptions(Callable<String> currentSearchTextGetter)
Findable.FindOptions.getAdditionalOptions()
As of 2007-09-20, only the nonadvanced options will be displayed. This may
be changed in the future.currentSearchTextGetter - A callback method through which a client can retrieve the current
value of the search text option, i.e. the value that (@link FindOptions#getText} would
have if a search was started now.public boolean canFindAll()
Findable.FindOptions.isFindAll() will return true if the user clicked the "Find All" button.
The default implementation returns falseFindable.FindOptions.isFindAll() will return true if the user clicked the "Find All" button