public abstract class SequenceDatabaseSuperService extends GeneiousServiceWithPanel
GeneiousPlugin.getServices() directly.
The databases provided by this service must be provided as child DatabaseServices. Each of these must return
a non-empty map from DatabaseService.getSequenceSearchPrograms(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType).
Sequence database can be provided by a plugin without implementing one of these, the sequence database only need
to return a non-empty value from DatabaseService.getSequenceSearchPrograms(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType).GeneiousService.ServiceStatus| Constructor and Description |
|---|
SequenceDatabaseSuperService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDatabase(AnnotatedPluginDocument[] annotatedDocuments,
String name,
Options options,
ProgressListener progressListener)
Add a new sequence database to the service from a selection of documents in Geneious.
|
void |
addDatabase(File file,
String name,
Options options,
ProgressListener progressListener,
DatabaseService.SequenceSearchQueryType expectedDatabaseType)
Add a new sequence database to the service from a file on disk.
|
void |
applySetupOptions(Options setupOptions,
ProgressListener progressListener)
Apply and save the specified setup options to the service.
|
List<GeneiousAction> |
getActionsEnabledWhenServiceSelected()
List of Geneious Actions which can appear in the menu bar, toolbar or popup-menu in the service tree.
|
Options |
getAddDatabaseOptions(DatabaseService.SequenceSearchQueryType databaseType)
Optionally override to return
Options which will be displayed
to the user (in addition to the standard options) before adding a sequence database. |
List<String> |
getDatabaseFileFormatExtensions()
A list of extensions for file formats that can be added directly to the service.
|
JPanel |
getPanel()
A panel that is displayed when this service is selected.
|
GeneiousPreferences |
getPreferences()
Use
getSetupOptions() instead |
String |
getServiceTreeLabel(boolean expanded,
boolean showAdditionalInformation)
Provide additional details for a human user.
|
Options |
getSetupOptions()
Optionally override to return
Options which will be displayed to
the user in a services set up section of the interface. |
boolean |
isSetUp()
If this method returns false then the user will not be allowed to choose this service as a search target until
they have set it up.
|
void |
removeDatabase(String uniqueId)
Remove the database with the given uniqueID (returned from
GeneiousService.getUniqueID()). |
void |
removeDatabase(String uniqueId,
ProgressListener progressListener)
Remove the database with the given uniqueID (returned from
GeneiousService.getUniqueID()). |
boolean |
showInServiceTree()
Override and return false to hide this service from the service tree.
|
boolean |
supportsAddingDatabasesFromDocumentsOrFiles()
Return true to have the program display options for choosing a file or using the selected documents to create a
database.
|
boolean |
supportsModifyingDatabases(DatabaseService.SequenceSearchQueryType databaseType)
Override and return true to enable the user interface for adding and removing of sequence databases of particular types
from this service.
|
getExtendedPrintable_shutdown, addGeneiousServiceListener, addWeakGeneiousServiceListener, canShutdown, getActionsAlwaysEnabled, getChildServices, getDescription, getFullPath, getGeneiousServiceListener, getHelp, getIcons, getName, getParentService, getStatus, getUniqueID, hasShutdownOrStartedShuttingDown, initialize, initializeService, isProOnly, removeGeneiousServiceListener, shutdown, toStringpublic boolean supportsModifyingDatabases(DatabaseService.SequenceSearchQueryType databaseType)
databaseType - the type of database to be modifiedpublic void addDatabase(File file, String name, Options options, ProgressListener progressListener, DatabaseService.SequenceSearchQueryType expectedDatabaseType) throws DatabaseServiceException
getDatabaseFileFormatExtensions() returns an empty list. This can
happen sometime later as long as the user is aware of progress (eg downloading blast executables).file - a file with one of the extensions specified by getDatabaseFileFormatExtensions() that should
be used to populate the databasename - the name chosen by the user for the database, the new DatabaseService
should return this as its name, if a database with this name already exists then the existing database should be replaced.options - the options returned from getAddDatabaseOptions(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType) after they have been displayed to the userprogressListener - ProgressListener to report progress of the add operation and allow cancellingexpectedDatabaseType - User selected type for the database, not guaranteed to be correct.DatabaseServiceException - if the service failed to add the database for any reasonpublic void addDatabase(AnnotatedPluginDocument[] annotatedDocuments, String name, Options options, ProgressListener progressListener) throws DatabaseServiceException
annotatedDocuments - the documents that the user has selected which should be used to populate the new sequence database.name - the name chosen by the user for the database, the new DatabaseService
should return this as its name, if a database with this name already exists then the existing database should be replaced.options - the options returned from getAddDatabaseOptions(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType) after they have been displayed to the userprogressListener - ProgressListener to report progress of the add operation and allow cancellingDatabaseServiceException - if the service failed to add the database for any reasonpublic void removeDatabase(String uniqueId) throws DatabaseServiceException
GeneiousService.getUniqueID()).
When called, the service should remove the child service corresponding to this uniqueIduniqueId - the uniqueId of the service to be removedDatabaseServiceException - if the service failed to remove the database for any reasonpublic void removeDatabase(String uniqueId, ProgressListener progressListener) throws DatabaseServiceException
GeneiousService.getUniqueID()).
When called, the service should remove the child service corresponding to this uniqueIduniqueId - the uniqueId of the service to be removedprogressListener - ProgressListener to report progress of the remove operation and allow cancellingDatabaseServiceException - if the service failed to remove the database for any reasonpublic Options getAddDatabaseOptions(DatabaseService.SequenceSearchQueryType databaseType)
Options which will be displayed
to the user (in addition to the standard options) before adding a sequence database.
These options will be passed to the addDatabase methods. Default returns null.databaseType - the type of sequences that the database will be created frompublic boolean isSetUp()
getSetupOptions() must return a non-null value so the user can set
the service up.
Default returns truepublic Options getSetupOptions()
Options which will be displayed to
the user in a services set up section of the interface. If the service must be set up in some way before it can be
used then the options returned from this method must allow the user to set up the service. If the service doesn't
require set up or if the service has already been set up then these options can be used to further configure the
service (eg. The location of the blast executables).
applySetupOptions(com.biomatters.geneious.publicapi.plugin.Options,jebl.util.ProgressListener) is called when these options should
be saved.
If this returns a non-null value then applySetupOptions(com.biomatters.geneious.publicapi.plugin.Options,jebl.util.ProgressListener) must
also be overriden. Default returns null.public void applySetupOptions(Options setupOptions, ProgressListener progressListener) throws DatabaseServiceException
getSetupOptions() have been displayed to the user and they have clicked OK. If the service is not
currently setup (ie isSetUp() returns false) then after this call the service should be setup. This can
happen sometime later as long as the user is aware of progress (eg downloading blast executables).setupOptions - Options to apply and saveprogressListener - to report progress of the setup operation and allow cancellingDatabaseServiceException - if the setup options couldn't be appliedpublic List<String> getDatabaseFileFormatExtensions()
public boolean supportsAddingDatabasesFromDocumentsOrFiles()
getAddDatabaseOptions(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType)
will be shown.
Note: if false is returned from this method then addDatabase(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], String, com.biomatters.geneious.publicapi.plugin.Options, jebl.util.ProgressListener)
will be called with an empty list of documents and when the user clicks OK. If false
is returned then the DatabaseService.SequenceSearchQueryType
passed in to getAddDatabaseOptions(com.biomatters.geneious.publicapi.databaseservice.DatabaseService.SequenceSearchQueryType)
should be ignored because options should be returned in all cases.
Default implementation returns truepublic String getServiceTreeLabel(boolean expanded, boolean showAdditionalInformation)
GeneiousServicegetServiceTreeLabel in class GeneiousServiceexpanded - if the service's children are visible in the tree.showAdditionalInformation - if true, then optionally add extra information,
such as the number of documents contained within the servicepublic boolean showInServiceTree()
GeneiousServiceGeneiousServiceListener.serviceTreeLabelChanged()showInServiceTree in class GeneiousServicepublic List<GeneiousAction> getActionsEnabledWhenServiceSelected()
GeneiousServicegetActionsEnabledWhenServiceSelected in class GeneiousServicepublic final GeneiousPreferences getPreferences()
getSetupOptions() insteadgetPreferences in class GeneiousServicepublic JPanel getPanel()
GeneiousServiceWithPanelgetPanel in class GeneiousServiceWithPanel